OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Error when attempting to Merge users

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.

Error when attempting to Merge users

Postby josephman » Tue Apr 03, 2012 6:10 am

Greetings all,

We have 100s of bogus users that were created over the past year. In an attempt to clean up users via the Merge Users function, we receive a 500 error in the browser. The Apache error log reports the following error:

[error] [client 128.148.41.121] PHP Fatal error: Call to undefined method Comment::setUserId() in /var/www/html/OJS/classes/user/UserAction.inc.php on line 52, referer: http://blah.univ.edu/OJS/index.php/Musi ... serIds=303

I'm including as much information as I can about out System:
Latest release of OJS (2.3.7.0)
OS: RHEL 5.3
Apache 2.2.3
PHP 5.3.0
MySQL 5.1.39

Any advice or assistance would be greatly appreciated. Please let me know if you need more detail.

Thanks. --Joe
josephman
 
Posts: 3
Joined: Tue Apr 03, 2012 5:51 am

Re: Error when attempting to Merge users

Postby JasonNugent » Tue Apr 03, 2012 8:47 am

Hi Joe,

That appears to be a bug. I'll file a bug for it in a second, but for now you can edit line 52 of classes/user/UserAction.inc.php and change setUserId to setUser. That should get you going.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 891
Joined: Tue Jan 10, 2006 6:20 am

Re: Error when attempting to Merge users

Postby josephman » Tue Apr 03, 2012 11:07 am

Hi Jason,

I changed setUserId to setUser as you stated and it resolved the undefined method error. Unfortunately, I continue to receive a 500 error in the browser. However, now the Apache log reads as follows:

[Tue Apr 03 14:01:59 2012] [error] PHP Fatal error: Call to a member function getId() on a non-object in /var/www/html/OJS/lib/pkp/c
lasses/comment/CommentDAO.inc.php on line 276, referer: http://library.brown.edu/OJS/index.php/ ... 199&search
Initial=M

Any suggestions?

Many thanks for your prompt response and help.

--Joe
josephman
 
Posts: 3
Joined: Tue Apr 03, 2012 5:51 am

Re: Error when attempting to Merge users

Postby JasonNugent » Tue Apr 03, 2012 3:52 pm

Hi again, Joe,

Seems like you've wandered into a bit of untested territory. The error is occurring because the $user variable on that line isn't an object, it's an integer. You can probably replace line 276 in CommentDAO with:

Code: Select all
(int)$user,


(note the comma at the end of the line). I'll amend the bug I filed earlier.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 891
Joined: Tue Jan 10, 2006 6:20 am

Re: Error when attempting to Merge users

Postby josephman » Wed Apr 04, 2012 6:00 am

Jason,

I used your code snippet to replace line 276 in CommentDAO.inc.php; the merge function is now working as it should.

Many thanks. -Joe
josephman
 
Posts: 3
Joined: Tue Apr 03, 2012 5:51 am

Re: Error when attempting to Merge users

Postby ramon » Fri Jul 05, 2013 3:46 pm

Hello all,

I tried searching but this is the most recent post related to our question.
Playing around with the merge users feature we came to realize the following, and want to know if it's the intended behavior.

When merging users with the Admin user, the roles are NOT assigned automatically, although the activities are.
We noticed this when we had a Section Editor, assigned to a section, removed the user by merging and added another Section Editor.
While the submissions to the section were not visible to the Section Editor (due to role security, as we understand it), because the submissions were assigned to a different section editor and cannot see the tasks from another.

When viewing as the Editor, the Admin is showing as the designated section editor. This works as supposed, as the previous Sec.Ed. was merged with the Admin.
However, when viewing as Admin, the submissions are not visible because the Sec. Ed. role was NOT assigned to the admin while merging.
And thus, our question(s):
  1. Is this the expected behavior? Meaning, does the Journal Manager have to assign the roles for those people to see the tasks?
  2. Shouldn't the role be applied automatically?
  3. Does this happen only to the Admin or does it happen to other users as well? If memory serves, the roles were assigned when merging users... but I can't say for sure, as we haven't really played until now with the merge users feature... and it has changed between versions, so...

Thank you all, and sorry for the long story...
_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Error when attempting to Merge users

Postby asmecher » Fri Jul 05, 2013 3:51 pm

Hi Ramón,

Roles have never been transferred when users are merged, and it's intended behavior. We were wary of anything that might accidentally grant privileges to a user that they didn't have before.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error when attempting to Merge users

Postby ramon » Sat Jul 06, 2013 7:35 am

Hi Alec,

Thanks for the quick response!
Glad to know it's the intended behavior.
We tend to forget these details as we don't use the system on a daily basis.
We're trying to document these and see how to maintain the documentation currently updated.

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Error when attempting to Merge users

Postby Pepix » Sat Oct 19, 2013 9:45 am

I ran into the same problem.
After selecting multiple users to merge I wanted to select the user to merge to from a different page (he was not on the first one)
after that I only get server error 500.
unfortunately I don't have access to the server log.

any hint how to troubleshoot this is greatly appreciated
Pepix
 
Posts: 2
Joined: Sat Oct 19, 2013 9:40 am

Re: Error when attempting to Merge users

Postby asmecher » Sat Oct 19, 2013 8:56 pm

Hi Pepix,

Without an error message you'll have a hard time debugging. There are some suggestions in the FAQ for ways to find error messages without needing the error log -- see the entry on resolving blank pages.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error when attempting to Merge users

Postby Pepix » Sun Oct 20, 2013 2:25 am

thanks, the blank pages entry helped me a lot.

I ended up upgrading the system to the latest release, after that I did not get error 500, but I get blank pages.
I have used the debug options in the index file, from which I decided for a clean install method to update which returned the system to a stable state.
and I am able to merge users again.
thanks

hint for others - don't try to merge users on 2.3.7 system
Pepix
 
Posts: 2
Joined: Sat Oct 19, 2013 9:40 am

Re: Error when attempting to Merge users

Postby JasonNugent » Sun Oct 20, 2013 4:22 am

Hi Pepix,

If you're encountering errors with 2.3.7 when merging users, you may want to look at our list of Recommended Patches for 2.3.7, which include a few that deal specifically with problems around merging users.

http://pkp.sfu.ca/wiki/index.php/OJS_2. ... ed_Patches

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 891
Joined: Tue Jan 10, 2006 6:20 am


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests