Link at Page Header Logo Image refers sometimes to Site, sometimes to Journal

We are using an OJS installation (3.1.2.1) with several journals. All journals are using completely individual layouts and domain names.

By chance we stumpled upon a problem already mentioned here [OJS 3.1.0-1] Journal Name/Logo redirects to the Journal List, but the fix mentioned there doesn’t work for us.

When I’m logged in as a user which is registered in one journal only the link refers to the site (!) homepage showing our general OJS homepage at www.biejournals.de. When I’m not logged in or when I’m logged in as a user which is registred in several journals the link refers to the respective journal homepage.

First of all, I think it should be the other way round. But why is here a difference at all? When I click on the journal’s logo I always want to get to the journal homepage, not sometimes to the site homepage. Or am I missing here something?

For the time being I just changed
/lib/pkp/templates/frontend/components/header.tpl

Old source code

{capture assign="homeUrl"}
  {if $currentContext && $multipleContexts}
    {url page="index" router=$smarty.const.ROUTE_PAGE}
  {else}
    {url context="index" router=$smarty.const.ROUTE_PAGE}
  {/if}
{/capture}

New code

{capture assign="homeUrl"}
  {url page="index" router=$smarty.const.ROUTE_PAGE}
{/capture}

Now I always get to the journal homepage, regardless if I’m logged in or not.

Hi @bibliothekswelt, we have the same problem, we have 3.1.2-1 too, and I found that /lib/pkp/templates/frontend/components/header.tpl doesn’t change in 3.1.2-4.
We agree with you that

@NateWr (you were on [OJS 3.1.0-1] Journal Name/Logo redirects to the Journal List), can you tell us if we are missing something or, if not, see if @bibliothekswelt’s code can be applied in future OJS releases?

Best regards,
Stefano Bolelli Gallevi

Hi @bolelligallevi,

As far as I can tell this should be fixed in all 3.1.2+ versions. It’s possible that your theme has overwritten this template and the source of the problem may be there.

If not, feel free to add a link to the journal where this is happening and I’ll take a look.

Hi @NateWr, thanks for your reply.
The journal is Schermi. Storie e culture del cinema e dei media in Italia, I don’t know if theme has overwritten the template, we also have add some custom css.
Remember that the link is to site home only when a Schermi-only user is logged in.
Best regards
Stefano

Hmm, in that case I won’t be able to reproduce the problem by looking at the site. I’d recommend switching to the default theme to see if that fixes anything.

Hi Nate,

can you indicate the GitHub patch that fixed this. I have 3.1.2-4 and still the old bug is in lib/pkp/templates/frontend/components/header.tpl

https://github.com/pkp/pkp-lib/blob/master/templates/frontend/components/header.tpl still has the old code in the master branch …

Hi @mpbraendle, I think this is the change: pkp/pkp-lib#3178 Fix home url in multi-context setup. by NateWr · Pull Request #3179 · pkp/pkp-lib · GitHub

Hi Nate,

yes, our OJS 3.1.2-4 installation had this one in the code. BUT: With this code, any user other than an journal admin and who is logged in is relayed to the homepage of the multijournal site, not to the journals homepage, when clicking on the logo of the journal.

@bibliothekswelt provided the correct patch.

Thanks @mpbraendle. I was able to reproduce the problem with your instructions and I’ve filed an issue to fix this: Logged out users directed to site homepage instead of journal homepage when logo is present · Issue #5813 · pkp/pkp-lib · GitHub.

Tx @NateWr - I checked your issue - it should be titled logged in user, not logged out.

Hmm, I was able to reproduce this as a logged out user. If you can add additional reproduction steps to the issue for other cases that will be helpful.

We could not reproduce it for a public user (nobody logged in), but only for users that were logged in and did not have role journal admin (as I wrote above) :wink: