Skip to content

Support Plone 6.1 #231

@ale-rt

Description

@ale-rt

If I run the upgrade script on Plone 6.1, I see in the instance logs:

2025-03-20 17:28:22,902 ERROR   [Zope.SiteErrorLog:35][waitress-0] AttributeError: http://localhost:8120/upgrades-api/list_plone_sites
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 390, in publish_module
  Module ZPublisher.WSGIPublisher, line 284, in publish
  Module ZPublisher.mapply, line 98, in mapply
  Module ZPublisher.WSGIPublisher, line 68, in call_object
  Module ftw.upgrade.jsonapi.utils, line 128, in json_wrapper
  Module ftw.upgrade.jsonapi.utils, line 109, in action_wrapper
  Module ftw.upgrade.jsonapi.zopeapp, line 15, in list_plone_sites
  Module ftw.upgrade.jsonapi.zopeapp, line 27, in _get_plone_sites
AttributeError: 'SimpleViewClass from /home/ale/.buildout/eggs/cp31' object has no attribute 'sites'

The reason is that this code:

overview_view = self.context.restrictedTraverse('plone-overview')
for site in overview_view.sites():

Fails on 6.1 because plone.distribution overrides the plone-overview with a view whose class does not have a sites method.

https://github.com/plone/plone.distribution/blob/51a13c21032325943f870c7feca2fcd5a8bec6bd/src/plone/distribution/browser/overrides.zcml#L34-L40

The package plone.distribution has anyway a helper to return the sites:
https://github.com/plone/plone.distribution/blob/51a13c21032325943f870c7feca2fcd5a8bec6bd/src/plone/distribution/api/site.py#L113-L136

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions