[Zope-CMF] Re: manage_predicates form bug when a factory-based type information has a title that differs from its id.

Patrick Decat pdecat@lfvie.generali.fr
Thu, 18 Oct 2001 14:47:00 +0200


Second try, using the correct encoding settings in Outlook Express.

Here is the patch :

===================================================================
RCS file: /cvs-repository/CMF/CMFCore/dtml/registryPredList.dtml,v
retrieving revision 1.2
diff -r1.2 registryPredList.dtml
26,28c26,29
<       <dtml-in listContentTypes>
<         <dtml-let item=sequence-item
<                   sel="item == typName and 'selected' or ''"
---
>       <dtml-in objectItems prefix="type">
>         <dtml-let typeName="type_item.title"
>                   typeId=type_key
>                   sel="typeId == typName and 'selected' or ''"
30c31
<          <option &dtml-sel;> &dtml-sequence-item; </option>
---
>          <option &dtml-sel; value="&dtml-typeId;"> &dtml-typeName; 
</option>
===================================================================

Patrick.

> From: "Patrick Decat" <pdecat@lfvie.generali.fr>
> To: <zope-cmf@zope.org>
> Sent: Thursday, October 18, 2001 2:33 PM
> Subject: manage_predicates form bug when a factory-based type information 
> has a title that differs from its id.
> 
> 
> Hi all,
> 
> I'm quite new to Zope and CMF so I may be wrong, but I think I've 
> encountered a bug
> in the manage_predicates form of the ContentTypeRegistry:
> 
> If a factory-based type information is defined in the portal_types having a 
> title that differs
> from its id, the manage_predicates form will use the title property instead 
> of the id to define
> predicates.
> 
> For example, I have the following factory-based type information in my 
> portal_types' folder
> associated to the 'file' predicate (matching all files with an extension) :
> id = 'CMFExternalFile'
> title = 'Fichier'
> 
> What's wrong is that when a PortalFolder's PUT_factory method is called, it 
> then calls
>         typeObjectName = registry.findTypeName( name, typ, body )
> which returns the string 'Fichier' instead of 'CMFExternalFile'.
> 
> Thus, the next call fails as I have no factory-based type information with 
> the id 'Fichier' in
> my portal_types:
>         self.invokeFactory( typeObjectName, name )
> 
> Here is the patch I've applied to the manage_predicates form to correct 
> this bug.
> 
> [..]
> 
> Regards,
> Patrick.