Michal Slocinski
|
Wednesday 09 July 2008 12:28:53 pm
Well, behavior is quite inconsistent - that's why I suspect it to be a bug. I've class which is kind of form where most of these 23 attributes are supposed to collect information. As long as class has 23 or less attributes all is fine. Once I add 24th attribute (regardless of it's type) I can't save or cancel class editor form. Each time I press 'Save' or 'Cancel' I'm redirected back to edit class view. When I try to add one more attribute, what happens is I'm redirected to edit class view again however there are still only 24 attributes while I'd expect to see 25.
Few minutes ago I just executed another test to see whether there is something wrong with this particular class or problem is more generic:
- create copy of Article class (standard Article as available in plain_site eZ Publish 4.0.1rc1 package)
- start adding 'Text line' attributes, none of them is configured to be information collector - just imagine copy of plain Article class with many additional 'text line' attributes added - when I reach total amount of 25 attributes, I can't add anything more, I can't also Save or Cancel class editor view - I'm redirected back to page editor I had some more time for debugging today so I looked as SQL queries executed when adding new attribute. I can see that when I add 25th attribute there is following insert to ezcontentclass_attribute table:
INSERT INTO ezcontentclass_attribute (serialized_name_list, version, contentclass_id, identifier, placement, is_searchable, is_required, can_translate, is_information_collector, data_type_string, data_int1, data_int2, data_int3, data_int4, data_float1, data_float2, data_float3, data_float4, data_text1, data_text2, data_text3, data_text4, data_text5) VALUES('a:2:{s:6:\"pol-PL\";s:14:\"nowy atrybut25\";s:16:\"always-available\";s:6:\"pol-PL\";}', 1, 27, '', 24, 1, 0, 1, 0, 'ezstring', 0, 0, 0, 0, 0.000000, 0.000000, 0.000000, 0.000000, '', '', '', '', '')
Now when I check DB, this row is there. Next, when I try adding 26th attribute, there is no more INSERT, but I see all rows (including 25th) updated, like that - which is normal as I saw these updates each time I add any attribute:
UPDATE ezcontentclass_attribute
SET serialized_name_list='a:2:{s:6:\"pol-PL\";s:14:\"nowy atrybut25\";s:16:\"always-available\";s:6:\"pol-PL\";}', contentclass_id=27, identifier='mmmm', placement=24,
is_searchable=1, is_required=0, can_translate=1, is_information_collector=0,
data_type_string='ezstring', data_int1=0, data_int2=0, data_int3=0, data_int4=0,
data_float1=0.000000, data_float2=0.000000, data_float3=0.000000, data_float4=0.000000,
data_text1='mmmm', data_text2='', data_text3='', data_text4='', data_text5=''
WHERE id='441' AND version='1'
I enabled debugging on all levels however I don't see there any errors, just these and other SQL queries plus some debugging information but no sign of error/warning messages apart of warnings related to i18n. As you can see in two situations described above for my original class where I experienced this problem it occurred after 24 attributes and after I created copy of plain Article class it happened after 25 attributes. I went even further and created copy of standard Folder class and behavior was the same as with Article - no more than 25 attributes got created. Let me know what you think, I'm happy to run some more tests or provide you more information if needed.
|