Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/main Date: 2024-09-11T20:06:13-07:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.restapi@057c59a Fix error getting allow_discussion when p.a.discussion is not activated. (#1808) * Fix error getting allow_discussion value when p.a.discussion is not activated. This fixes an error in Plone 6.1 when the `plone.app.discussion` package is available but not activated in the Add-ons. Problem is that the `conversation_view` is only defined when the browser layer of `plone.app.discussion` is found. Sample error: ``` Traceback (innermost last): Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents Module ZPublisher.WSGIPublisher, line 391, in publish_module Module ZPublisher.WSGIPublisher, line 285, in publish Module ZPublisher.mapply, line 98, in mapply Module ZPublisher.WSGIPublisher, line 68, in call_object Module plone.rest.service, line 21, in __call__ Module plone.restapi.services, line 19, in render Module plone.restapi.services.content.get, line 16, in reply Module plone.restapi.serializer.dxcontent, line 179, in __call__ Module plone.restapi.serializer.dxcontent, line 142, in __call__ Module plone.restapi.serializer.dxcontent, line 48, in get_allow_discussion_value Module zope.component._api, line 113, in getMultiAdapter zope.interface.interfaces.ComponentLookupError: ((<FolderishDocument at /PloneVolto/page>, <WSGIRequest, URL=http://localhost:8080/PloneVolto/++api++/page/GET_application_json_>), <InterfaceClass zope.interface.Interface>, 'conversation_view') ``` * Fix tests: Plone Site now gets allow_discussion false instead of null. Files changed: A news/1808.bugfix M src/plone/restapi/serializer/dxcontent.py M src/plone/restapi/tests/http-examples/jwt_logged_in.resp M src/plone/restapi/tests/http-examples/navroot_site_get.resp M src/plone/restapi/tests/http-examples/navroot_standard_site_content_get.resp M src/plone/restapi/tests/http-examples/navroot_standard_site_content_get_expansion.resp M src/plone/restapi/tests/http-examples/navroot_standard_site_get.resp M src/plone/restapi/tests/http-examples/navroot_standard_site_get_expansion.resp M src/plone/restapi/tests/http-examples/site_get_expand_navroot.resp M src/plone/restapi/tests/http-examples/siteroot.resp
- Loading branch information