Martijn Faassen wrote at 2004-5-24 09:50 +0200: > ... >I know this has been reported before but I haven't looked into it yet. >I'm wondering how to handle Formulator upgrades though -- just checking >if you've been registered in a previous startup is not enough if the >help text changes between releases, is it? > >It's been a long time since I worked with the Zope help system..
I attach my previous patch. It may no longer work, though. -- Dieter
--- FieldRegistry.py~ Tue Jun 12 17:01:20 2001 +++ FieldRegistry.py Wed Jan 16 23:34:08 2002 @@ -49,16 +49,17 @@ if (hasattr(field_class, 'internal_field') and getattr(field_class, 'internal_field')): continue - - # unregister any help topic already registered - if field_name in help.objectIds('Help Topic'): - help._delObject(field_name) - # register help topic ht = FieldHelpTopic(field_name, "Formulator Field - %s" % field_name, field_class) + + # unregister, if necessary + if field_name in help.objectIds('Help Topic'): + if ht == help._getOb(field_name): continue + help._delObject(field_name) + context.registerHelpTopic(field_name, ht) def initializeFields(self): --- FieldHelpTopic.py~ Tue May 1 18:11:17 2001 +++ FieldHelpTopic.py Wed Jan 16 23:34:08 2002 @@ -32,4 +32,26 @@ """Get the fields in the group. """ return self.field_class.form.get_fields_in_group(group) + + def __eq__(self,other): + try: + gs= self.get_groups() + if gs != other.get_groups(): return 0 + for g in gs: + fs= self.get_fields_in_group(g) + ofs= other.get_fields_in_group(g) + if len(fs) != len(ofs): return 0 + for i in range(len(fs)): + f= fs[i]; of= ofs[i] + if f.id != of.id \ + or f.get_value('title') != of.get_value('title') \ + or f.get_value('description') != of.get_value('description'): + return 0 + return 1 + except AttributeError: return 0 + + + def __ne__(self,other): return not (self == other) + +
_______________________________________________ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )