OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

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.

Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby uscguitarte » Mon Apr 29, 2013 4:59 pm

Hi,

I've upgraded my site running 2.1.1.0 to 2.4.2.0 and have run into an issue where the affiliations are missing from the user profile/edit screen.

Looking at the database, prior to the upgrade, the users table > affiliations column held this data.

After the upgrade, the users table no longer has this affiliations column.

It appears that the upgrade causes the structure of affiliations to become localized (http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=5550). I checked the user_settings table for rows related to this (setting_name = affiliations) but did not see any.

Can you suggest a fix for this, or in the interim an SQL query to run on the database prior to the update so that we can create the correct structure needed to support the localization of non localized affiliations?

Thanks,
Chris
USC Annenberg
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby asmecher » Mon Apr 29, 2013 5:13 pm

Hi Chris,

The user interests are now stored in a somewhat convoluted way, for the sake of code re-use. Check the controlled_vocab_entry_settings table to see if they're in place there.

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

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby uscguitarte » Tue Apr 30, 2013 10:48 am

asmecher wrote:The user interests are now stored in a somewhat convoluted way, for the sake of code re-use. Check the controlled_vocab_entry_settings table to see if they're in place there.


Hi Alec,

Thanks for your prompt reply. I'm looking at the controlled_vocab_entry_settings table and only see three types of entries in the setting_name (description, interest, and name).

I'm looking for the user "affiliation" previously stored in the users table as of 2.1.1.0 - not the "interests".

Do you have any suggestions? I didn't see any errors when running the upgrade script.

Thanks!
Chris
USC Annenberg
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby asmecher » Tue Apr 30, 2013 11:20 am

Hi Chris,

Sorry, I wrote that last response on autopilot, hence the interests/affiliations confusion.

The users' affiliations should've become localized during the OJS 2.3.3 upgrade (see dbscripts/xml/upgrade/2.3.3_preaffiliations1.xml). Off the top of my head, if you have a backup of your pre-upgrade database, you can bring in the affiliations by loading that backup into a different database and running a cross-database query based on the following upgrade query taken from the script mentioned above:
Code: Select all
INSERT INTO user_settings (user_id, setting_name, setting_type, setting_value, locale) SELECT u.user_id, 'affiliation', 'string', u.affiliation, s.primary_locale FROM users u, site s
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9229
Joined: Wed Aug 10, 2005 12:56 pm

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby uscguitarte » Tue Apr 30, 2013 2:48 pm

Hi Alec,

Thanks for your follow up!

I tried running the query without any modifications and ran into an error. It appeared that columns used in that query were missing from two tables.

First, the user_settings table was missing the locale column.
Second, the site table was missing the primary_locale column.

I had to make some manual modifications before executing the query manually on the backup database (Originally OJS 2.1.1.0)

table modifications:
user_settings - add column: locale | varchar | length=5 | allow Null=no | default=blank
site - add column: primary_locale | varchar | length=5 | allow Null=no | default=en_US

then manually run query:
Code: Select all
INSERT INTO user_settings (user_id, setting_name, setting_type, setting_value, locale) SELECT u.user_id, 'affiliation', 'string', u.affiliation, s.primary_locale FROM users u, site s


then run upgrade script.

I saw that your referenced xml file that the query is pulled from wasn't run (based on the console output). I looked inside the XML and it required 2.2.0.0 (see dbscripts/xml/upgrade/2.3.3_preaffiliations1.xml). Note, I'm upgrading from 2.1.1.0.

Code: Select all
<upgrade minversion="2.2.0.0" maxversion="2.3.3.9">


For now it appears that I'll need to do the steps manually above before performing the upgrade. Perhaps this is a bug where an additional query needs to be added to prepare the database before the dbscripts/xml/upgrade/2.3.3_preaffiliations1.xml script is run on upgrades from 2.1.1.0?

Thanks again,
Chris
USC Annenberg
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby asmecher » Tue Apr 30, 2013 2:54 pm

Hi Chris,

Actually, I was recommending loading a DB dump prior to upgrade and adapting the query quoted above (which is intended for a single database) into a cross-database query. That way you could fetch from the pre-upgrade database and insert into the post-upgrade database. Your process seems like it would work as well, though.

This is indeed a bug, but I'm tempted to drop the upgrade scripts for 2.1.x entirely rather than go through the testing matrix required to make sure the cure is better than the disease. OJS 2.2.0 was released in 2007 and anything before that really is well past its end-of-life.

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

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby gemusehandler » Mon May 20, 2013 1:31 am

Kinda related problem here. Clean install of 2.4.2. Can't perform a 'Browse by Author' (sidebar). This option does forwards you to the 'Browse Author Index' but clicking an individual author brings you to the 'Search' page, not to an overview of articles produced by the author. So far I have not used the affiliation field. But... if I do, then the 'Browse Author Index' is broken off just above the author that I have given an affiliation. What to do?
gemusehandler
 
Posts: 30
Joined: Sun May 19, 2013 12:30 am

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby asmecher » Mon May 20, 2013 11:12 am

Hi gemusehandler,

Have you tried the suggestion at http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=9838?

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

Re: Affiliations Lost after Upgrade from 2.1.1.0 to 2.4.2.0

Postby gemusehandler » Tue May 21, 2013 12:08 pm

Thanks man, problem is now solved.
gemusehandler
 
Posts: 30
Joined: Sun May 19, 2013 12:30 am


Return to OJS Technical Support

Who is online

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