6.4.2.14.
Indexes declared in Archetypes schemata need to be moved to GenericSetup
Up one level
This applies if you have moved from using install_types() in Extensions/Install.py, to installing new content types/FTIs with GenericSetup using a types.xml import step.
For each field that specifies an index, like this example from PoiIssue.py r40594
:
StringField(
name='issueType',
index="FieldIndex:schema",
widget=SelectionWidget(
label="Issue type",
description="Select the type of issue.",
label_msgid='Poi_label_issueType',
description_msgid='Poi_help_issueType',
i18n_domain='Poi',
),
enforceVocabulary=True,
vocabulary='getIssueTypesVocab',
required=True
),
…you need to move the creation to catalog.xml with GenericSetup. If there is index="FieldIndex", that means you need a new index, of type FieldIndex, with the name being the name of the accessor method:
<index name="getIssueType" meta_type="FieldIndex">
<indexed_attr value="getIssueType"/>
</index>
If there is also :schema or :metadata, e.g. index="FieldIndex:schema", you also need a metadata column:
<column value="getIssueType"/>
This is necessary because the schema does not really exist at install time, so there is no way GenericSetup can inspect it and configure new indexes. This was a bad design from the start, as portal-wide indexes do not belong in type-specific schemata anyway.