Forums / Setup & design / User class update doesn't work

User class update doesn't work

Author Message

Aleksander Lech

Wednesday 14 December 2005 3:53:41 am

Hello
I edited user class (added some custom datatypes to it) and new users have custom attributes visible and working, but user accounts created prior to edit user class shows 'old' version and editing user data does'n help.
Any suggestions how to update user account because deleting acounts and recreating them seems not funny.

Greetings
Aleksander

Mark Marsiglio

Wednesday 14 December 2005 4:31:23 am

How many "old" users do you have? My understanding is that upon updating a class a script runs that updates all of the existing objects of that class to add the new attribute(s).

We just did this for a class that had several hundred existing objects of that class, and only a few of them received the update. We theorized that the script was timing out before it finished updating.

We had been planning on beefing up hardware anyway, so we are waiting until the new hardware is in before running the script.

An alternate solution might be to modify php.ini to make the Max execution time in the php.ini longer (a few minutes) while you make the class changes.

Another important step would be to clear the cache.

Let me know if this turns out to be the problem for you, because we have not tested the "theory" yet.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Aleksander Lech

Wednesday 14 December 2005 6:12:54 am

The problem isn't in PHP but in ezPublish user class. We did modified user class, and now new user accounts has new attributes, but old ones doesn't.

The question is: how to update old accounts so it has new attributes without deleting and recreating those accounts.

Aleksander

Mark Marsiglio

Wednesday 14 December 2005 12:45:11 pm

The database structure of ez is such that each class has a series of class attributes. When you create a new object, it creates a new record in the database for each attribute of the class, and then relates those to the object.

When you already have objects of a class on the system, those attributes were assigned to the object based on the old class definition.

eZ Publish does automatically update all existing objects of that class when an attribute is added to the class, unless the script that ez uses to update the existing objects in the database does not run, does not finish, or runs incorrectly.

You should not have to remove and recreate your users. That would not be normal behavior. As a test, you might want to try adding an attribute to another class, and seeing if objects in that class are updated. Or try adding another class to the user object to get the script to run again.

If I am understanding the situation wrong, maybe someone with a better knowledge of the system or someone from eZ can correct me.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Aleksander Lech

Thursday 15 December 2005 12:57:54 am

Well, I add text-line attribute to user class, and old accounts has this attribute, but doesn't have any of mentioned above.

So this kind of update did not helped.

Greetings
Aleksander