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

eZ debug

Timing: Jan 30 2025 21:36:51
Script start
Timing: Jan 30 2025 21:36:51
Module start 'content'
Timing: Jan 30 2025 21:36:51
Module end 'content'
Timing: Jan 30 2025 21:36:52
Script end

Main resources:

Total runtime0.1887 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.0781370.2969
Module start 'content' 0.00630.0116 959.37501,005.5156
Module end 'content' 0.01800.1706 1,964.89063,893.9688
Script end 0.1886  5,858.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00432.2717200.0002
Check MTime0.00120.6542200.0001
Mysql Total
Database connection0.00060.319610.0006
Mysqli_queries0.102554.35001410.0007
Looping result0.00110.59631390.0000
Template Total0.170290.210.1702
Template load0.00070.380510.0007
Template processing0.169589.842210.1695
Override
Cache load0.00050.271410.0005
Sytem overhead
Fetch class attribute can translate value0.00150.812610.0015
XML
Image XML parsing0.00020.102210.0002
General
dbfile0.00764.0225200.0004
String conversion0.00000.001630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs