OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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.

Merge users

Postby AndyP » Tue May 22, 2007 9:38 am

I can't get the merge users function to work. My firefox debugger says

unterminated string literal
all?oldUserId=147... (line 1)
confirmAction('http://www.mydomain.com/ojs/index.php/myjournal/manager/mergeUsers?oldUserId=1472&newUserId=152', 'Are you sure you wish to merge the account with the username "drgrs1" into the account with the username

I've had no luck with IE etiher. Any suggestions?
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby AndyP » Tue May 22, 2007 9:42 am

Also, one of the users I'm trying to merge is an author in another journal, will all these associations be merged as well?
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby asmecher » Tue May 22, 2007 10:09 am

Hi Andy,

Yes, the user's assets will be merged for all journals.

Could you view the source of the page and copy the complete code for the "Merge" link, including the confirmAction call, and post it here? It sounds like there's something funny in the way your install is generating that link, but I can't duplicate it here.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8337
Joined: Wed Aug 10, 2005 12:56 pm

Postby AndyP » Tue May 22, 2007 10:20 am

<a href="#" onclick="confirmAction('http://www.myjournals.com/ojs/index.php/myjournal/manager/mergeUsers?oldUserId=1472&amp;newUserId=152', 'Are you sure you wish to merge the account with the username &quot;drgrs1&quot; into the account with the username
&quot;graemesmith&quot;? The account with the username &quot;drgrs1&quot; will not exist afterwards. This action is not
reversible.')" class="action">Merge User</a>
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby asmecher » Tue May 22, 2007 10:45 am

Hi AndyP,

That code is valid, except that it's broken up onto multiple lines. Are there line breaks in the original source code, or was that an artifact of posting in the forum?

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8337
Joined: Wed Aug 10, 2005 12:56 pm

Postby AndyP » Wed May 23, 2007 3:04 am

Hi Alec

The line breaks appear when selecting 'view source'. They are not an artifact of pasting into the forum
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby asmecher » Wed May 23, 2007 9:29 am

Hi AndyP,

OK, that line break is causing the problem. If you look in your locale file (locale/en_US/locale.xml) at the locale key called "admin.mergeUsers.confirm", does it appear with a line break? Likewise, in the cache file cache/fc-locale-39ad57a0a799a092b476f7b3d029e60d.php, does a line break appear?

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8337
Joined: Wed Aug 10, 2005 12:56 pm

Postby AndyP » Wed May 23, 2007 9:59 am

Hi Alec

The locale.xml file does have the line breaks - it has them for a number of other keys as well. It's not the exact key you asked me to look for, but the closest I could find

<message key="manager.people.mergeUsers.confirm">
Are you sure you wish to merge the account with the username "{$oldUsername}" into the account with the username
"{$newUsername}"? The account with the username "{$oldUsername}" will not exist afterwards. This action is not
reversible.
</message>

From fc-locale-en_US.php

'manager.people.mergeUsers.confirm' => 'Are you sure you wish to merge the account with the username "{$oldUsername}" into the account with the username
"{$newUsername}"? The account with the username "{$oldUsername}" will not exist afterwards. This action is not
reversible.',

Are these line breaks something we have accidentally introduced ourselves by saving changes to the locale.xml carelessly?
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby asmecher » Wed May 23, 2007 10:09 am

Hi AndyP,

That's the right key -- its name has changed since OJS 2.1.1 from admin.mergeUsers.confirm to manager.people.mergeUsers.confirm. Yes, I suspect that accidental locale file changes are the cause; usually it won't matter at all, but in one or two cases (such as this, since Javascript is linebreak-sensitive for quoted strings) it will.

I'd suggest cleaning up these changes, since you'll also have a tougher time upgrading if a large number of spurious whitespace changes are getting in the way. You can do this using the following steps:
  • Generate a list of actual changes you've made using the diff tool:
    Code: Select all
    diff -u -w /path/to/original-locale-file /path/to/modified-locale-file > generated-patch.diff
  • Review generated-patch.diff to make sure it looks OK
  • Apply that patch to a stock 2.1.1 locale file and use the resulting locale file for your installation, which should now be equivalent to your changed locale file but without spurious whitespace changes.
Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8337
Joined: Wed Aug 10, 2005 12:56 pm

Postby AndyP » Wed May 23, 2007 10:44 am

Hi Alec

Many thanks for your help, as usual.

To test the merge users function I removed the two offending line breaks.

I successfully merged the two users. The system allocated a submitted article from a different journal to the new user code correctly. However it did not move across the role of 'Author' for that journal to the new merged user and I had to do this manually.

I will let you know if I still get this problem once all the other line breaks are cleared from locale.xml

Best regards

Andy
AndyP
 
Posts: 57
Joined: Wed Mar 22, 2006 8:21 am

Postby asmecher » Wed May 23, 2007 11:25 am

Hi Andy,

Merge Users doesn't transfer roles; it only transfers assets such as submitted articles. That means that unless the new user also has an Author role, they won't be able to view their own submissions. We decided that automatically transferring roles made too many assumptions from a security perspective.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8337
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests