Forums / General / Problem with changing attributes of a class

Problem with changing attributes of a class

Author Message

Martina Steinkuhle

Thursday 11 December 2003 3:55:52 am

I have a problem with changing the attributes of a class. I have created a class with 7 attributes. After that I created some objects of this class and then I changed the class. It got a new attribute. Now all my objects of this class have become useless because they have now only one Attribut and I can only edit this attribute.

Any suggestions what I can do, or do I have to delete them all and make some new.

Anybody else ever had this problem?

Tore Skobba

Thursday 11 December 2003 6:41:20 am

Hmm not me.. I have been adding attributes to several of my classes? Existing objects then simply have one more "empty" attribute. But have you:

- Added an attribute which is required (I do not know what would happen but all existing objects would the be invalid)
- Removed and added attributes
- Touched atributes making up the name

What EZ version are you running.

Cheers
Tore

Martina Steinkuhle

Friday 12 December 2003 12:59:35 am

I added an attribute, which is not required. When I added attributes to classes before, the existing objects had also empty attributes, like you wrote. But this time they are all useless. I didn't do it different like the other times. I don't know what happened. I think this must be a bug.

Claus Jensen

Friday 12 December 2003 1:08:25 am

Hi, and welcome to the group!
There are several people experiencing this now, no solution yet. What version are you using? Read more here:
http://ez.no/developer/ez_publish_3/forum/general/class_attributes_gone_when_editing_class

Maybe you could send a database dump to Bård, as I have already cleaned up mine since it is live, so I cant send an example to Bård.

My solution for this was to delete, yes DELETE the objects we had, and yes, we had about 3000 objects!!! It was NO FUN AT ALL! And then make the objects again, and just HOPE IT DONT HAPPEN AGAIN.

regards,
claÜs

Tore Skobba

Friday 12 December 2003 3:00:29 am

Frigthing is all I can say... Hope I do not fall into that group.. But I am afraid I will cause I have a user class which is supposed to have dynamic attributes.. I.e adding and removing of attributes as is deemed neccesary. I belive hell will be loose if suddenly all user objects are lost. In the cases you are describing, are there any possiblities of rollback (remove the new attributes, and then all objects are fine ?).

Cheers
Tore

Claus Jensen

Friday 12 December 2003 3:22:21 am

In the cases you are describing, are there any possiblities of rollback (remove the new attributes, and then all objects are fine ?).

No, the objects only had 4 of the 69 attributes when I look directly in the ezcontentobject_attribute table vs the ezcontentclass_attribute table. So it seems the store function only took the new added attributes and stored them instead of all of them. And if I were you, I would do some SERIOUS tests on this before putting such a system as you describe to life. Suddenly users will have only 1 or 2 attributes. That has actually happened to some of my users as well, because I added some addressfields and such to the existing user class. And then all the other attributes were gone in the objects!!! BEWARE!

Only rollback that will fix this as Im aware of is to take dumps of the db and restore if anything is wrong, but a poor solution. In my examples when I look at the user class, all versions of objects that were of this class, were "corrupted" by this bug.

regards,
claÜs

eZ debug

Timing: Jan 18 2025 16:27:55
Script start
Timing: Jan 18 2025 16:27:55
Module start 'content'
Timing: Jan 18 2025 16:27:56
Module end 'content'
Timing: Jan 18 2025 16:27:56
Script end

Main resources:

Total runtime0.7543 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.9531180.8203
Module start 'content' 0.00670.6203 769.7734546.4531
Module end 'content' 0.62700.1272 1,316.2266337.7891
Script end 0.7542  1,654.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4805210.0002
Check MTime0.00130.1782210.0001
Mysql Total
Database connection0.00080.106710.0008
Mysqli_queries0.687991.20352050.0034
Looping result0.00190.24812030.0000
Template Total0.726196.320.3630
Template load0.00180.243020.0009
Template processing0.724396.018520.3621
Template load and register function0.00020.025410.0002
states
state_id_array0.00120.164310.0012
state_identifier_array0.00070.096720.0004
Override
Cache load0.00160.2068340.0000
Sytem overhead
Fetch class attribute can translate value0.00250.334940.0006
Fetch class attribute name0.00110.139360.0002
XML
Image XML parsing0.00060.077140.0001
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00170.2235210.0001
String conversion0.00000.000830.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs