[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Fixed bug in the export code of persistent utilities with explicit OFS ids.
Hanno Schlichting
hannosch at hannosch.eu
Mon Jan 4 15:33:06 EST 2010
Log message for revision 107645:
Fixed bug in the export code of persistent utilities with explicit OFS ids.
Changed:
U Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
U Products.GenericSetup/trunk/Products/GenericSetup/components.py
-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt 2010-01-04 20:16:06 UTC (rev 107644)
+++ Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt 2010-01-04 20:33:06 UTC (rev 107645)
@@ -4,6 +4,8 @@
1.6.0 (unreleased)
------------------
+- Fixed bug in the export code of persistent utilities with explicit OFS ids.
+
- Prefer the class over the five:implements ZCML directive.
1.5.0 (2010-01-01)
Modified: Products.GenericSetup/trunk/Products/GenericSetup/components.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/components.py 2010-01-04 20:16:06 UTC (rev 107644)
+++ Products.GenericSetup/trunk/Products/GenericSetup/components.py 2010-01-04 20:33:06 UTC (rev 107645)
@@ -19,7 +19,6 @@
from zope.component import adapts
from zope.component import getUtilitiesFor
-from zope.component import getSiteManager
from zope.component import queryMultiAdapter
from zope.component.interfaces import ComponentLookupError
from zope.component.interfaces import IComponentRegistry
@@ -494,9 +493,12 @@
child.setAttribute('factory', factory)
if factory is not None:
ofs_id = self._ofs_id(child)
- name = getattr(comp, '__name__', '')
+ name = getattr(comp, '__name__', None)
if ofs_id != name:
- child.setAttribute('id', name)
+ if name is not None:
+ child.setAttribute('id', name)
+ else:
+ child.setAttribute('id', ofs_id)
fragment.appendChild(child)
More information about the checkins
mailing list