Discussion:
[Erp5-dev] Differnt uid types for Image
Łukasz Nowak
2006-08-21 15:47:49 UTC
Permalink
Hello,

I've added to portal_type Product allowed portal type Image. Then, I had
ability to add images to Products.

Everything went fine, since validation was made on Product.
Error Type: ValidationFailed
Error Value: product_module/2/1,PropertyTypeValidity
inconsistency,104,Attribute uid should be of type long but is of type
<type 'int'>,Type Validity Check Error,;
(Error Value was changed by me, to have full info)

Well, after some test there is something strange.

Eg:

organisation_module/1/1 - its Image portal_type
product_module/2/1 - its also Image portal_type

But:

For type(product_module/1/1.getUid()) is <type 'int'>, and
type(organisation_module/1/1.getUid()) is <type 'long'> (I've made
ExtMeth to got this results. Same result for uid property.)

Why Image portal type have uid type int in Resource and long type in
Organisation? Do I have to change something in Document or PropertySheet
connected with Resource? I haven't seen any special tweaks for
Document/Organisation to have portal_type Image in it...

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the source, Luke...''
Lukasz Nowak
2006-09-13 11:53:15 UTC
Permalink
Hello,
Post by Łukasz Nowak
Hello,
(...)

After adding File object to Person such information is logged:

2006-09-13T13:47:20 TRACE(-300) SQLDict invoking a group method
portal_catalog/catalogObjectList with 1 objects (1 objects in expanded form)
2006-09-13T13:47:20 TRACE(-300) SQLCatalog catalogging 1 objects
2006-09-13T13:47:20 PROBLEM(100) SQLCatalog uid of <File
at /erp5/person_module/4/1> changed from 38100L to 38101 !!! This can be
fatal. You should reindex the whole site immediately.

And after that, I cannot validate person, because validator for Person object
gets type from File (which is magiclly int, not long). Well,
self.getPropertyType('uid') returns 'long', but self.getProperty(key='uid')
returns 'int'. What a mess... :(

I was trying some magic with
~/Products/ERP5Type/Constraint/PropertyTypeValidity.py but I cannot find out
what could be wrong. I'd love to squash that bug, but I worry, that w/o some
clue, I cannot go any further...

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
Lukasz Nowak
2006-09-19 12:17:06 UTC
Permalink
Hello,
Post by Łukasz Nowak
Hello,
All problems with File was resolved with SVN revision 10148. Thanks.

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
Loading...