[Erp5-dev] error on wiki page, pls check
Jérôme Perrin
jerome at nexedi.com
Tue Mar 28 18:44:58 CEST 2006
Le Mardi 28 Mars 2006 16:32, Bartek Gorny a écrit :
> Hi
>
> Can somebody please check the wiki page that I wrote two days ago, on
> HowToAddTableToCatalog? I figured out that what I wrote there is
> wrong, because the z_catalog_email_list is called every time I reindex
> any object, which throws an exception if it the object is not an email
> address. So I guess there must be a way to specify which catalog
> methods are called when reindexing certain portal_types, or something
> like that, but I don't know how.
Hi bartek
Currently, in various catalog method (stock, movement, item ...) we check
wether we should index the object in the method.
For exemple, z_catalog_movement_list first check the list of objects that are
actually movement (using isMovement attribute) and only catalog them if the
attribute is true.
So in your case, you can just filter the list of objects, using for example
getPortalType.
But this may still fail for empty emails, you have use "optional" attribute to
dtml-sqlvar so that it doesn't complain with None values.
- <dtml-sqlvar expr="getUrlString[loop_item]" type="string">
+ <dtml-sqlvar expr="getUrlString[loop_item]" type="string" optional>
Another solution can be cataloging objects only if getUrlString is not None.
--
Jérome
More information about the Erp5-dev
mailing list