eZ Community » Forums » Developer » How can I create a new attribute...
expandshrink

How can I create a new attribute through a script?

How can I create a new attribute through a script?

Monday 11 September 2006 1:13:42 pm - 7 replies

I have a class called article. If I add an attribute to this article in the admin-interface, I get a timeout and only some articles stored in the database get this attribute.

The solution is to add this attribute to the class, and to the existing objects of this class in the database by using a script, but how?

Are there any script for this available today for ez? I've seen many postings about this, but haven't found any links to scripts, only text that says: you have to create this in the db through a script if your database already contains too many objects of this class..then it will not work adding this in the ez admin interface.

Hope someone can help.

Monday 11 September 2006 1:28:22 pm

Hi K

I think you can use this one: http://ez.no/community/contribs/hacks/update_class_from_command_line

Enable the apply button in the class edit interface, that will make storing your temporary class version easier. In content.ini.append.php:

[ClassSettings]
ApplyButton=enabled

Modified on Monday 11 September 2006 1:32:17 pm by Kristof Coomans

Thursday 14 September 2006 10:04:28 am

What is the reason for this problem? PHP execution timeout? Would it solve the problem just (temporarily) increasing the timeout value?

Thursday 14 September 2006 1:26:41 pm

No, it will not help us so much. With too many objects, there "will be" a timeout. We already got the limit too high.

Thursday 14 September 2006 1:28:05 pm

Btw. Is it possible to fix this through mysql? I prefer fixing these things with sql rather than messing around with scripts and versions of classes blunk.gif Emoticon

Thursday 14 September 2006 4:22:05 pm

Hi K

I think running plain SQL queries to do this could mess up your eZ publish database more than using CLI scripts and some kernel functions.

Thursday 14 September 2006 11:34:46 pm

Hello K259

Did you try the script mentioned by Kristof? I might need something like this later on and would be interested in the results you got with it.

Claudia

Friday 15 September 2006 9:03:37 am

Hi Claudia!

No, I'm thinking about another solution. There have to be a better and easier way to do this.

K259

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from