Details
-
Bug
-
Resolution: Fixed
-
Medium
-
3.10.0, 4.0.0beta1
-
None
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 == "" )
/** 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