Skip to content

Commit

Permalink
added implicit migration of HelpSys catalog to avoid AttributeError, …
Browse files Browse the repository at this point in the history
…_length

failures during the Zope startup phase caused by the index cleanup in Zope 2.8
  • Loading branch information
zopyx committed Feb 13, 2005
1 parent e87f1b6 commit afd11a6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ZCatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,11 @@ def manage_convertIndexes(self, REQUEST=None, RESPONSE=None, URL1=None):
idx_type = idx.meta_type
idx_id = idx.getId()
LOG.info('processing index %s' % idx_id)
if idx_type == 'FieldIndex' and idx_id in ('start', 'modified', 'end', 'created'):
if idx_type == 'FieldIndex' and idx_id in ('start', 'modified',
'end', 'created'):
idx_type = 'DateIndex'
if idx_type == 'FieldIndex' and idx_id in ('effective', 'expires'):
if idx_type == 'FieldIndex' and idx_id in ('effective',
'expires'):
idx_type = 'DateRangeIndex'
indexed_attrs = getattr(idx, 'indexed_attrs', None)
self.delIndex(idx.getId())
Expand All @@ -938,10 +940,11 @@ def manage_convertIndexes(self, REQUEST=None, RESPONSE=None, URL1=None):
setattr(new_idx, 'indexed_attrs', indexed_attrs)
self.manage_reindexIndex(idx_id, REQUEST)

self._migrated_280 = True
LOG.info('Finished migration of indexes for %s' % self.absolute_url(1))

RESPONSE.redirect(
URL1 +
if RESPONSE:
RESPONSE.redirect( URL1 +
'/manage_main?manage_tabs_message=Indexes%20converted%20and%20reindexed')


Expand Down

0 comments on commit afd11a6

Please sign in to comment.