plone/Products.CMFPlone — pull request #7 by jcbrand (2011-12-06 22:39:00+00:00)
Title: Use portal_type for the "Item Type" ATPortalTypeCriterion.

The **Item Type** ATPortalTypeCriterion, despite its name, actually uses the *Type* index and not the *portal_type* index.

The *Type* index, indexes the *Title* property of a content type, and not its
*portal_type*.

This can cause problems when you're expecting the "Item Type" criterion to be
able to differentiate between different content types with the same Title
property (which currently happens with VSEvents, VSSubEvents and Events).

Poking around in Products.ATContentTypes, I see that Hanno already identified this as a problem some months ago: (in Products.ATContentTypes/criteria/portal_type.py)

```
(WouterVH 2011-06-30 01:33:37 +0000 50) if self.Field() == 'Type':
(Hanno Schlichting 2011-07-02 14:33:36 +0000 51) # Switch the value from portal_type to the Title msgid
(WouterVH 2011-06-30 01:33:37 +0000 52) # since that is stored in the Type-index in portal_catalog
(Hanno Schlichting 2011-07-02 14:33:36 +0000 53) # TODO: we should really use the portal_type index here and
(Hanno Schlichting 2011-07-02 14:33:36 +0000 54) # remove the Type index
(Hanno Schlichting 2011-07-02 14:33:36 +0000 55) value = unicode(portal_types[value].Title())
```