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

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