[Product-Developers] context.UID() vs IUUID(context) on collective.disqus

Joaquin Rosales globojorro at gmail.com
Tue Sep 20 15:05:02 UTC 2011


Hello,

 I've been working with a Plone 4.1 site that uses dexterity-based
content along with the default archetypes-based content that comes with
Plone.

 The Dexterity-based content is using plone.app.referenceablebehavior to
get an archetypes-like UID, and everything works fine: I can reference
archetypes-content from dexterity-content and vice versa.

 However, when using collective.disqus, there is a problem with the
disqus_viewlet, as it calls explicitly for a UID() method on the context
(which Archetypes has, but not Dexterity, which is provided the UID
field by adaptation), and the whole view is broken by the viewlet
whenever I'm on a dexterity-content.

 I've downloaded collective.disqus' trunk and modified
collective.disqus.viewlets.content from:

....
      disqus_identifier = self.context.UID()
....

to:

....
from plone.uuid.interfaces import IUUID
....
      disqus_identifier = IUUID(self.context)
....


 This does the trick and everything works fine again.

 I've tried contacting the project owner (as referenced in the
plone.org/products page), reporting this, however it's possible that my
message didn't get through.

 I'd like to get these changes into the package, so I'm wondering if
anyone else here is contributing to collective.disqus and if it is
possible/viable to collaborate on this.

 Thanks all, cheers.

-joaquín




More information about the Product-Developers mailing list