[OJS 3.3.0.8] Add user ID to profile form

Hello anyone,

Description of issue or problem I’m having:
Since our user search via interface is taking forever (I’m testing a search on a user, since yesterday and it’s still running!), I need the user_id in the profile form, besides the username.

This is necessary because we need to find the users and sometimes manually set their password and set-new-password-on-login option in the database.

The registration e-mail and email password reset messages are also not being received by some users, which is causign havoc in our editorial process.

Steps I took leading up to the issue:
User search is not working and need access to user profile data. User sent email claiming reset password message is not coming in.

Had to access profile as editor and change email address temporarily to a personal email to be able to test reset password, which worked.

What I tried to resolve the issue:
Tried editing templates/user/identityForm.tpl to add $userid, $user_id, $userId, but apparently the variable is not available in this templates (which is VERY odd!).

I opened this forum question.

I changed user email to one I had access to reset password, which received the message.

Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.8

Additional information, such as screenshots and error log messages if applicable:

Eternal unending search
image

@ramon have you merged in the latest fixes to the stable-3_3_0 OJS branch and corresponding lib-pkp branch? Our developer, Jonas, has merged in a bunch of commits that remedy the search performance for us, even in installations with more than ten thousand users.

Best
Jason

Hello @jnugent ,

We are using OJS 3.3.0.8, so I assume the code is current.
We are unable to use GIT as our network prevents such use at this time.

Hi @ramon

No, the code is not current. These fixes have been merged quite recently, and will appear in 3.3.0.9 when it is released. If you’re using the official download of 3.3.0.8 released back in August 2021, you are missing quite a few bug fixes since then.

Best
Jason

Hello @jnugent ,

Which files exactly do I need to download?

Hi @ramon

I wouldn’t want to simply recommend files to download or a patch to apply since there have been many modifications and changes to SQL queries in a variety of places in order to improve speed.

This is the Github issue with most of the discussion and links to relevant merge requests:

And this looks like the bulk of the modifications here:

Best
Jason

Hello @jnugent ,

How am I going to apply these corrections without GIT?

Hi @ramon

you’ll need to export those changes out of git as a patch file, and then apply it via the command line using the patch command.

Here’s the diff: https://patch-diff.githubusercontent.com/raw/pkp/pkp-lib/pull/7414.diff

You’d place that file in your lib/pkp directory and then run the following command from that directory.

patch -p1 --dry-run < 7414.diff

And if there are no errors reported you can remove the --dry-run and try it again. Please make a full backup of your OJS installation first. Since this only affects the UserGroupDAO.inc.php file you can probably just make a copy of that.

Best
Jason

Hello @jnugent,

Thanks for the .diff file.
I tested the patch command and got a malformed message at line 209 but that’s all…

:/var/www/revista.ibict.br/lib/pkp# patch -p1 --dry-run < ojs3-mysql-diffs-7414.diff
checking file classes/security/UserGroupDAO.inc.php
patch: **** malformed patch at line 209:

And it’s basically the end of the file, with a closing " } "…

[UPDATE]
There were missing two minus signs after line 209 when I first copied… no errors indicated now.

:/var/www/revista.ibict.br/lib/pkp# patch -p1 --dry-run < ojs3-mysql-diffs-7414.diff
checking file classes/security/UserGroupDAO.inc.php

Does that mean the patch would be applied correctly?

Hi @ramon
That does indeed mean it will go cleanly. I’d recommend backing up the classes/security/UserGroupDAO.inc.php file just to be sure you can roll back easily but yes, you should be able to apply it now.

Best
Jason

Hello @jnugent ,

YESSS!!!
Patch applied successfully!
User search now fully functional and extremely fast!

Thank you!!

2 Likes

Great news! Glad it worked out for you. These changes are already in the next versions of OJS so this shouldn’t have be reapplied when you upgrade next.

Best
Jason

1 Like