Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update side_panels.py #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update side_panels.py #1

wants to merge 2 commits into from

Conversation

aekong
Copy link
Owner

@aekong aekong commented Nov 2, 2023

The most recent release of wagtail 5.2 replaces PagePreviewSidePanel with PreviewSidePanel.

wagtail_localize/side_panels.py needs a small update to comply

@catilgan-nextension
Copy link

catilgan-nextension commented Nov 3, 2023

Hi! I'm using your changes in wagtail-localize module for the Wagtail 5.2 upgrade. It works, but there are issues/bugs within the LocalizedPageSidePanels class.

The __init__ method arguments in the base class are changed. This may affect other classes as well.

class LocalizedPageSidePanels(PageStatusSidePanel):
    def __init__(self, request, page, translation):
        super().__init__(
            # - order of page & request arguments are changed.
            page,
            request,
            # - these arguments are removed
            # preview_enabled=False,
            #comments_enabled=False,
            #show_schedule_publishing_toggle=False,
        )

If i try to translate an existing page, i get this following error message:

In template /usr/local/lib/python3.12/site-packages/wagtail/admin/templates/wagtailadmin/shared/side_panel_toggles.html, error at line 3

'LocalizedPageSidePanels' object is not iterable

{% load wagtailadmin_tags %} 
{% for panel in side_panels %}
    {% component panel.toggle %}
{% endfor %}

Many thanks for addressing these issues. Kind regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants