From: Benoît Pin Date: Wed, 3 Jul 2013 21:49:45 +0000 (+0200) Subject: bugfix : on vérifie que le parent implémente bien l'interface d'ordonancement. X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/commitdiff_plain/56a307ecc4a84fab4a72ce037fe39ad20fbc16f7?hp=222b91ba8896448e7a120103959760cb84d6db10 bugfix : on vérifie que le parent implémente bien l'interface d'ordonancement. --- diff --git a/catalog_adapters.py b/catalog_adapters.py index 64130ad..86b2c3b 100644 --- a/catalog_adapters.py +++ b/catalog_adapters.py @@ -1,7 +1,9 @@ from Products.CMFCore.CatalogTool import IndexableObjectWrapper +from OFS.interfaces import IOrderedContainer class PlinnIndexableObjectWrapper(IndexableObjectWrapper) : def position(self) : parent = self.getParentNode() - pos = parent.getObjectPosition(self.getId()) - return pos \ No newline at end of file + if IOrderedContainer.providedBy(parent) : + pos = parent.getObjectPosition(self.getId()) + return pos \ No newline at end of file