# HG changeset patch # User Sylvain Thénault # Date 1492088685 -7200 # Node ID 608481168432be1fa53ea74f5232d0d9e1a9db27 # Parent 8a1306c4365644dcbe564c65975a6e3404cd88f9 [entities] Fix backward compat of IDublinCore adapter wrt dc_long_title `entity.dc_long_title()` used to fallback to `dc_title()`, and most entity types were relying on this, thus only implementing the later. Since introduction of the IDublinCore adapter, if one call `entity.dc_long_title()` on an entity that only implements `dc_title()`, it will retrieve the adapter which will then call its own `title()` method instead of the `dc_title()` method of the entity as expected. Fix this by calling instead `entity.dc_title()` which will eventually kick in the backward compat layer if necessary. diff -r 8a1306c43656 -r 608481168432 cubicweb/entities/adapters.py --- a/cubicweb/entities/adapters.py Thu Apr 13 13:57:32 2017 +0200 +++ b/cubicweb/entities/adapters.py Thu Apr 13 15:04:45 2017 +0200 @@ -49,7 +49,9 @@ def long_title(self): """Return a more detailled title for entity""" - return self.title() + # go through entity.dc_title for bw compat purpose: if entity define dc_title but not + # dc_long_title, we still want it to be considered. + return self.entity.dc_title() def description(self, format='text/plain'): """Return a suitable description for entity"""