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

500 error when saving page after changing title #3319

Open
osmers opened this issue Jan 7, 2025 · 4 comments
Open

500 error when saving page after changing title #3319

osmers opened this issue Jan 7, 2025 · 4 comments
Labels
bug Something isn't working needs-further-investigation This issue needs some further research/investigation prio: medium Should be scheduled in the forseeable future.
Milestone

Comments

@osmers
Copy link

osmers commented Jan 7, 2025

Describe the Bug

Sometimes a 500 error is shown after changing the title of a page in Farsi, Arabic and Russian (maybe other languages too) and trying to save the changes. Although the 500 errror is shown, the changes are still saved.
I haven't yet found a way to reliably reproduce this...

Steps to Reproduce

tbd

Expected Behavior

Page is saved without 500 error.

Actual Behavior

Sometimes 500 error shows up but changes are still saved.

Additional Information

Traceback Jan 16 18:30:27 ERROR django.request - 500 Internal Server Error: /dortmund/pages/fa/10877/edit/ Traceback (most recent call last): File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper return bound_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/contextlib.py", line 81, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/opt/integreat-cms/.venv/lib/python3.11/site-packages/integreat_cms/cms/views/pages/page_form_view.py", line 346, in post "page_id": other_translation.page.id, ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'page'
@osmers osmers added bug Something isn't working needs-further-investigation This issue needs some further research/investigation labels Jan 7, 2025
@JoeyStk JoeyStk added this to the Backlog milestone Jan 14, 2025
@JoeyStk JoeyStk added the prio: medium Should be scheduled in the forseeable future. label Jan 14, 2025
@JoeyStk JoeyStk modified the milestones: Backlog, Next-up Jan 14, 2025
@JoeyStk
Copy link
Contributor

JoeyStk commented Jan 16, 2025

Reproduced
in: Stadt Wertheim and Dortmund.
Go to Dortmund, select Farsi, go to the page "Gesundheit"/"Health" and change the title to:
مقامات و ادارات ادارات ادارات

and the slug to:
مقامات-و-ادارات-ادارات-ادارات

Save the slug by click on the disk icon, then save, see 500 error

Worked for me in three regions

@JoeyStk
Copy link
Contributor

JoeyStk commented Jan 16, 2025

This seems to be related to a NoneType error of other_translation in page_form_view that needs to be handled

@juliankehne
Copy link

juliankehne commented Jan 21, 2025

Just noting down what I found while reproducing this:

  • The language of the page is irrelevant, e.g. also happens in German
  • The title field needs to be focused before clicking Update to cause this error
  • Slug in web page URL and Title need to be different

Steps to always reproduce:

  1. Go to any page
  2. Change the slug to anything thats different to the title (optional)
  3. Click on the title field to focus it
  4. Click Update
  5. See Error

or

  1. Go to any page
  2. Click on the title field to focus it
  3. Change the title to something different
  4. Do not click anywhere else or lose focus of title field
  5. Click Update
  6. See Error

@JoeyStk
Copy link
Contributor

JoeyStk commented Jan 21, 2025

@juliankehne Thank you so much! This helps a lot! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-further-investigation This issue needs some further research/investigation prio: medium Should be scheduled in the forseeable future.
Projects
None yet
Development

No branches or pull requests

3 participants