You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an index which belongs to a field returned by the call to portal_atct (tool.getEnabledFields()) is not actually present in the portal_catalog, the criteriaByIndexId method breaks on attempting to retrieve the index object from portal_catalog.
Such a circumstance can arise, for example, if you install alm.solrindex which by default deletes text indexes such as Title and Description and gives over indexing those fields to solr. The line of code linked above throws a key error which then prevents the widget from rendering at all.
One possible fix is to wrap the lookup in a try...except clause like so:
It seems like, so long as the index is not present in the catalog, there would certainly be no criteria associated with it that would be valid, so returning an empty iterable maintains the contract of the method while protecting against this edge case.
The text was updated successfully, but these errors were encountered:
When an index which belongs to a field returned by the call to
portal_atct
(tool.getEnabledFields()
) is not actually present in theportal_catalog
, thecriteriaByIndexId
method breaks on attempting to retrieve the index object fromportal_catalog
.Such a circumstance can arise, for example, if you install
alm.solrindex
which by default deletes text indexes such asTitle
andDescription
and gives over indexing those fields to solr. The line of code linked above throws a key error which then prevents the widget from rendering at all.One possible fix is to wrap the lookup in a try...except clause like so:
It seems like, so long as the index is not present in the catalog, there would certainly be no criteria associated with it that would be valid, so returning an empty iterable maintains the contract of the method while protecting against this edge case.
The text was updated successfully, but these errors were encountered: