Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26181

Content with same name as URL matcher will lead to broken links

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Fixed
    • Affects Version/s: 5.4.7, 5.4.8
    • Fix Version/s: Customer request, 5.4.9
    • Component/s: None
    • Labels:
      None

      Description

      If we have a content with the same name as the matcher URI, then the matcher/siteaccess part of the URL will be discarded, leading to broken links.

      Steps to reproduce:
      1. Install demo site
      2. Configure TransformationGroup=urlalias_iri in site.ini
      3. Configure site admin to be matched with the following (http://fivefour.local/Admin/):

              match:
                  Compound\LogicalAnd:
                      my_compound_rule_1:                                            
                          matchers:                                                   
                              Map\URI:                                                
                                  Admin: true                                  
                              Map\Host:                                               
                                  fivefour.local: true
                          match: ezdemo_site_admin
      

      4. Create a new folder under images in media section and name the folder to be "Admin"
      5. Navigate to "Admin" folder and create a new image
      6. Try to navigate to the new image with the children list
      7. Error is shown because generated URL is malformed: http://fivefour.local/Media/Images/Admin/Photo
      8. Confirm that image is actually displayed under correct URL: http://fivefour.local/Admin/Media/Images/Admin/Photo

        Issue Links

          Activity

          Hide
          Gunnstein Lye added a comment - - edited

          Confirmed. Actually, special characters are not needed to reproduce this, the bug is the same with "Admin". I have updated the issue name and description to reflect that.

          It is caused by the use of array_diff to determine the siteaccess part of the URL, here:
          https://github.com/ezsystems/LegacyBridge/blob/master/bundle/LegacyMapper/SiteAccess.php#L88

          When the the path-without-siteaccess contains an element that equals the siteaccess, the diff is empty, and the siteaccess is not found, and subsequently removed from all URLs.

          Show
          Gunnstein Lye added a comment - - edited Confirmed. Actually, special characters are not needed to reproduce this, the bug is the same with "Admin". I have updated the issue name and description to reflect that. It is caused by the use of array_diff to determine the siteaccess part of the URL, here: https://github.com/ezsystems/LegacyBridge/blob/master/bundle/LegacyMapper/SiteAccess.php#L88 When the the path-without-siteaccess contains an element that equals the siteaccess, the diff is empty, and the siteaccess is not found, and subsequently removed from all URLs.
          Show
          Gunnstein Lye added a comment - PR: https://github.com/ezsystems/LegacyBridge/pull/62
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.4.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.4.
          Show
          Gunnstein Lye added a comment - Merged in LegacyBridge master: https://github.com/ezsystems/LegacyBridge/commit/d30373f67c3ee339aa64946e9533b275351d0746

            People

            • Assignee:
              Unassigned
              Reporter:
              Ricardo Correia (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 1 hour
                3d 1h