[OJS 3.1.2.] User registration impossible if a journal is not on the site

We have a multi-journal instance. One of the journals is a showcase.
Users who want to register for another journal cannot do that if its presence on the site is not enabled: "Administration > Hosted Journals > JOURNALNAME Edit > Enable this journal to appear publicly on the site (ticked). It would be great if this were possible.

Hi @varachkina,

The intention of the “Enable this journal” checkbox is to hide that journal from any kind of visibility e.g. on a multi-journal installation. Can you describe in more detail what you’d like to accomplish?

Regards,
Alec Smecher
Public Knowledge Project Team

It seems to be the case that if a journal is hidden, users cannot register for it. I want them to be able to register anyway. They access the registration page via the link that I give them, but nothing happens when they try to submit their data. If I enable this journal to appear publicly on the site, the registration becomes possible.

Hi @varachkina,

I think you may be running into an unrelated issue. What role options does the registration form give you for the showcase journal? (A screenshot of that section of the form might help.)

Regards,
Alec Smecher
Public Knowledge Project Team

They seem related to me.
Screenshot_2020-02-14%20Login%20CeMig%20Global%20Migration%20Studies
If the option “Enable this journal to appear publicly on the site” is not selected and you click “register” - nothing happens.
However, if it is selected and you click “register”, you get there:


Sorry, previously I wrote that the problem occurs when users try to submit their data, and it’s not the case.

Hi @varachkina,

Sorry, previously I wrote that the problem occurs when users try to submit their data, and it’s not the case.

Thanks, that helps clarify.

It’s not clear to me that users should be able to register for a disabled journal, so I’m hesitant to permit that by default. But if you’d like to tweak that behaviour, it’s implemented in lib/pkp/classes/core/PKPPageRouter.inc.php in the route function:

// Redirect requests from logged-out users to a context which is not
// publicly enabled
if (!defined('SESSION_DISABLE_INIT')) {
    $user = $request->getUser();
    $currentContext = $request->getContext();
    if ($currentContext && !$currentContext->getEnabled() && !is_a($user, 'User')) {
        if ($page != 'login') $request->redirect(null, 'login');
    }
}

You would need to add an exemption for the user page as well (and there may be other tweaks needed as I haven’t tested/tweaked this further).

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, so I need to remove !$currentContext->getEnabled()?
Can you please clarify your comment about the user page and where to find its implementation?

Hi @varachkina,

I can’t walk you through modifications in much detail, but you can see that the login page is excluded in the above code. Off the top of my head, you’d also need to exclude the case where $page is user and $op is either register or registerUser. This will probably take further tweaking as other parts of the code may expect the journal to be enabled.

Regards,
Alec Smecher
Public Knowledge Project Team