I’m using the Structure module, and trying to print out the breadcrumbs. I don’t think this related to Structure though, seems more like a PHP issue. In the breadcrumbs method there is this:
$uri = trim($TMPL->fetch_param('uri'));
$uri = $uri ? $uri : $IN->URI;
If I send in the uri param as “/news/archive/” a var_dump on $uri reports a string length of 26 characters, but if I set the value of $uri to “/news/archive/” directly within the PHP, var_dump reports a string of 14 characters, which is true. The problem is the breadcrumb method doesn’t work when I use fetch_param because the string length is incorrect. It works if I manually set the value because it finds an exact character match of “/news/archive/” within the site_pages database field.
What could be going on in the TMPL class to add extra characters to the param?
Found out that it is encoding my forward slashes…
string(13) "/products"
If I remove slashes, it works just fine, but I need to be able to send in “/products/view/” as a URI string. Is there something in the admin area to change this behavior?
Since this occurs in a 3rd party module I just added $uri = str_replace(‘& #47;’, ‘/’, $uri); and it works fine. (without the space between & and # obviously).
Is there something in the admin area to change this behavior?
No, I believe you might be running into a safety feature of EE here.
Since this occurs in a 3rd party module I just added $uri = str_replace(‘& #47;’, ‘/’, $uri); and it works fine. (without the space between & and # obviously).
I am glad to hear that. Let me move this thread to “Modules”.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.