Current page link in breadcrumbs broken

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 14
Joined: Wed Jan 19, 2011 8:22 pm

Current page link in breadcrumbs broken

Postby mgregson » Tue Jul 31, 2012 5:03 pm

We are using the RESTful URL option and mod_rewrite in single journal installs to remove both 'index.php' and the journal component, e.g., rather than Under our setup, the link to the current page in the breadcrumbs is always broken because it includes the journal component, see for an example.

From httpd conf:

Code: Select all

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^(/lib/|/styles/|/plugins/|/public/|/templates/)
RewriteRule ^(.*)$ /index.php/jld$1 [QSA,L]


Code: Select all

base_url[jld] =
restful_urls = On

It seems like a bug that the breadcrumbs are using a URL that doesn't observe the base_url[jld] setting from the config file.

I did some investigation but the appropriate fix is not clear to me. Currently the link target comes from the $currentUrl variable set by PKPTemplateManager::setupTemplate() with a call to PKPRequest::getCompleteUrl() which calls getRequestPath(). In our case this latter function is essentially returning the value of $_SERVER['PATH_INFO'] which includes the 'jld' part. I'm not sure whether these functions should observe the base_url setting or whether something new is required.

The environment is OJS 2.3.7, httpd 2.2.3 and PHP 5.3.3.

Advice or a patch would be welcome!


Posts: 14
Joined: Wed Jan 19, 2011 8:22 pm

Re: Current page link in breadcrumbs broken

Postby mgregson » Sun Aug 12, 2012 10:50 pm

In a similar vein, the base URL reported in the OAI-PMH feed also doesn't reflect the modified base_url[jld], see The base URL is populated by PKPRequest::getRequestUrl() as the final/current page link in the breadcrumbs is.

My current view is that PKPRequest::getRequestPath() is returning an incorrect value because it doesn't match the path component in the URL in the HTTP request. Can anyone advise whether this is correct or not?

Return to “OJS Technical Support”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest