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

[BUG] CMS 4.1 slug is readonly when changing Page title #7866

Open
1 of 2 tasks
aacimov opened this issue Apr 8, 2024 · 9 comments
Open
1 of 2 tasks

[BUG] CMS 4.1 slug is readonly when changing Page title #7866

aacimov opened this issue Apr 8, 2024 · 9 comments

Comments

@aacimov
Copy link

aacimov commented Apr 8, 2024

Description

On already existing page you can change the title afterwards but not its slug (it has a readonly attribute in HTML).

Steps to reproduce

  1. Create a page with title (slug gets prepopulated)
  2. Create a new draft of the page (to be able to edit Page settings)
  3. Go to page settings
  4. Edit the title (works as expected)
  5. Edit the slug (it's readonly - no success)

Expected behaviour

You should be able to change the slug field or it should get prepopulated from the new title.

Actual behaviour

Slug field is not editable.

Additional information (CMS/Python/Django versions)

  • Python 3.10
  • Django CMS 4.1.0
  • Django 4.2.11

Do you want to help fix this issue?

  • Yes, I want to help fix this issue and I will join #workgroup-pr-review on Slack to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.
@jrief
Copy link
Contributor

jrief commented Apr 29, 2024

We experienced the same problem. This is caused by adding the language tabs to the admin detail view of PageContent.

In my opinion this does not make sense, because this is an editor opened for a specific page in a specific language. Therefore offering another tab to edit the page title in another language is confusion for other users.

I patched this in our own version of django-CMS, so that no language tabs are shown anymore.

I would suggest that we shall remove the language tabs in the upstream branch as well.

@aacimov
Copy link
Author

aacimov commented Apr 29, 2024

I believe this was fixed in the latest develop-4. Correct me if I am wrong.

@fsbraun
Copy link
Sponsor Member

fsbraun commented Apr 29, 2024

@jrief I think this is a separate problem. Switching the language tabs does result in the expected setting of read-only fields.

@aacimov For a draft page, the slug should be editable, however. It is not a django admin read-only field, which would not render a widget. I find a text input widget which has the readonly attribute set. I'm investigating. Can you double-check that if you manually remove the readonly attribute, you can actually change it and save it?

@fsbraun
Copy link
Sponsor Member

fsbraun commented May 2, 2024

So far, I've failed to reproduce this on django CMS 4.1.1. @aacimov Can you try?

@aacimov
Copy link
Author

aacimov commented May 2, 2024

So far, I've failed to reproduce this on django CMS 4.1.1. @aacimov Can you try?

Working as expected. I do have only 1 language in my current project where I am testing. I will try to reproduce in a multilingual website and let you know.

@aacimov
Copy link
Author

aacimov commented May 5, 2024

@fsbraun I can confirm this is still not working in 4.1.1. It seems to me I am getting a little crazy since I am sure it was working when I was using the latest develop-4 version.

@fsbraun
Copy link
Sponsor Member

fsbraun commented May 5, 2024

@aacimov Can you verify the steps above? I tested with a brand-new project (djangocms testproj), where I added a second language in the settings and am still not able to reproduce the issue.

@aacimov
Copy link
Author

aacimov commented May 5, 2024

I am apparently going crazy. Tried again after upgrading PyCharm and now it works. I really don't know what to say.
It's notable mentioning I did delete the __pycache__ folder after upgrading, maybe that helped.

@fsbraun
Copy link
Sponsor Member

fsbraun commented May 17, 2024

I found and fixed it :-)

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

No branches or pull requests

3 participants