From 181846b29a6fefdf30c8f16c730f07bf0cf0c068 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 8 Oct 2017 12:56:31 +0200 Subject: [PATCH] fix indexing stuff (externalIdentifier) --- concept.py | 5 ++++- integrator/source.py | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/concept.py b/concept.py index 75497f0..cf3f5ae 100644 --- a/concept.py +++ b/concept.py @@ -463,7 +463,10 @@ class IndexAttributes(object): #if self.adapted != self.context: if isinstance(self.adapted, AdapterBase): #return component.queryAdapter(self.adapted, IIndexAttributes) - return IIndexAttributes(self.adapted, None) + iattr = IIndexAttributes(self.adapted, None) + if iattr.__class__ == self.__class__: + return None + return iattr def text(self): if self.adaptedIndexAttributes is not None: diff --git a/integrator/source.py b/integrator/source.py index 8c0773f..6266e31 100644 --- a/integrator/source.py +++ b/integrator/source.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2017 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ from zope import interface, component from zope.interface import implements from zope.component import adapts -from loops.common import adapted +from loops.common import adapted, AdapterBase from loops.interfaces import ILoopsObject from loops.integrator.interfaces import IExternalSourceInfo @@ -47,7 +47,9 @@ class ExternalSourceInfo(object): def getExternalIdentifier(self): # first try to find adapter on adapted concept or resource adobj = adapted(self.context) - if adobj != self.context: + #if adobj != self.context: + #if not adobj is self.context: + if isinstance(adobj, AdapterBase): adaptedSourceInfo = IExternalSourceInfo(adobj, None) if adaptedSourceInfo is not None: return adaptedSourceInfo.externalIdentifier