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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 04:22:33
Script start
Timing: Jan 19 2025 04:22:33
Module start 'layout'
Timing: Jan 19 2025 04:22:33
Module start 'content'
Timing: Jan 19 2025 04:22:34
Module end 'content'
Timing: Jan 19 2025 04:22:34
Script end

Main resources:

Total runtime0.6976 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 590.2891152.6250
Module start 'layout' 0.00660.0051 742.914139.4609
Module start 'content' 0.01170.6843 782.3750559.3359
Module end 'content' 0.69600.0016 1,341.710916.1641
Script end 0.6976  1,357.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5327160.0002
Check MTime0.00150.2108160.0001
Mysql Total
Database connection0.00080.110710.0008
Mysqli_queries0.635491.0766630.0101
Looping result0.00070.0959610.0000
Template Total0.663495.120.3317
Template load0.00190.268920.0009
Template processing0.661594.820320.3307
Template load and register function0.00020.022510.0002
states
state_id_array0.00100.137210.0010
state_identifier_array0.00100.143320.0005
Override
Cache load0.00160.2302320.0001
Sytem overhead
Fetch class attribute can translate value0.00070.096020.0003
Fetch class attribute name0.00160.226160.0003
XML
Image XML parsing0.00060.084720.0003
class_abstraction
Instantiating content class attribute0.00000.002470.0000
General
dbfile0.00090.1343150.0001
String conversion0.00000.002540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs