And even better...
This canonical way of getting the default page, would also have helped finding the issue in your case pretty fast, since the method does certain checks to make sure the passed object provides the right "features". A string would not pass those checks.
0
GhitaB
On
default_page = getattr(x, 'default_page', None) is the answer. But make sure you have an object for x.
My mistake was I tried b.getObject().absolute_url() in my query instead of b.getObject().
By using
getattryou may override plone default behavior regarding how to determinate the default page of an object (item or container).Content objects in Plone inherit
BrowserDefaultMixin, which provides the functionality of getting the default page of a objectThe mixin, respectively a utility used by the mixin provides the desired method called
getDefaultPageThis will return the right
content objectorviewdepending on the configuration on the object, on the FTI and on the View itself and more.Have a look at
get_default_pagefor more details.And even better... This canonical way of getting the default page, would also have helped finding the issue in your case pretty fast, since the method does certain checks to make sure the passed object provides the right "features". A string would not pass those checks.