OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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., http://www.jld.edu.au/index rather than http://www.jld.edu.au/index.php/jld/index. Under our setup, the link to the current page in the breadcrumbs is always broken because it includes the journal component, see https://www.jld.edu.au/ 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]


From config.inc.php:
Code: Select all
base_url[jld] = https://www.jld.edu.au
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!

Cheers
Mark
mgregson
 
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 https://www.jld.edu.au/oai. 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?
mgregson
 
Posts: 14
Joined: Wed Jan 19, 2011 8:22 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests