Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] Changing page template fails when CMS tree is showing a different site #8276

Open
@stefanw

Description

@stefanw

Description

When using a multi-site setup, Django CMS allows to switch the CMS page tree to other sites via the triple-dot menu. When doing this, the keycms_admin_site is set in the session. Changing the template of a page from a different site (that is open in a different tab) now gives a 404 error.

Steps to reproduce

Steps to reproduce the behavior:

  1. Open a page on Site A and go into edit mode in tab 1.
  2. Open the page tree and switch it to site B in tab 2.
  3. Change the template on the page in tab 1.
  4. See 404 error.

Expected behaviour

The template change should be saved.

Actual behaviour

A broken message modal pops up with your project's 404 page. It's confusing because the site enabled viacms_admin_site is not communicated when editingPageContent.

Additional information (CMS/Python/Django versions)

This happens in CM 5.0.1, Python 3.12, Django 5.2.

The reason is thatPageContentAdmin.get_queryset automatically filters bycms_admin_site and theget_object call of thechange_template view goes throughget_queryset. It should probably not filter by site when directly accessing aPageContent object (site filters are likely only useful for list views in this context). This could be done by addingkwargs toget_object andget_queryset that enables/disables the site filter.

Alternatively, the session mechanism could be removed and the CMS page tree could be filtered explicitly via asite query parameter instead.

Do you want to help fix this issue?

  • Yes, I want to help fix this issue and I will join the channel #pr-reviews onthe Discord Server to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp