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

Bug with new url aliases using case sensitive names and dashes in 3.10.0

    XMLWordPrintable

Details

    Description

      If I create a node in the media library, named (for instance) "Example english", I can reach this node using the URL: http://mysite/Media/Files/Example-english

      But, if inside a template I try to get back this node using it's path via

      {def $mynode = fetch( 'content', 'node', hash( 'node_path', '/Media/Files/Example-english'))}

      , the given node is not found.

      After looking at the code, I noticed that inside the ezcontentobject_tree, this path_identification_string is not existing at all, but still existing in the old-style: example_english (lowercase with underscore)

      I did a quick-and-dirty fix in ezcontentobjecttreenode.php:

      function fetchByURLPath( $pathString, $asObject = true )
      {
      if ( $pathString == "" )

      { eZDebug::writeWarning( 'Can not fetch, given URLPath is empty', 'eZContentObjectTreeNode::fetchByURLPath' ); return null; }

      /** FIX **/
      $pathString = str_replace( '-', '_', strtolower($pathString) );
      /** /END OF FIX **/

      return eZContentObjectTreeNode::fetch( false, false, $asObject, array( "path_identification_string" => $pathString ) );
      }

      I guess a better solution has to be found.

      Steps to reproduce

      see desc

      Attachments

        Activity

          People

            a29ca475-2ac3-469b-95ea-e37ca79eae29@accounts.ibexa.co Sergiy Pushchin
            landre landre
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: