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

Cannot edit translation for BlogPage #12074

Closed
data-sync-user opened this issue Mar 19, 2024 · 3 comments
Closed

Cannot edit translation for BlogPage #12074

data-sync-user opened this issue Mar 19, 2024 · 3 comments

Comments

@data-sync-user
Copy link
Collaborator

{quote}Editing certain translated pages throws an error 500. Here I’m trying to edit https://foundation.mozilla.org/fr/blog/mozilla-research-platforms-election-interventions-in-the-global-majority-are-ineffective/ {quote}

┆Issue is synchronized with this Jira Bug

@data-sync-user
Copy link
Collaborator Author

➤ Jhonatan Lopes commented:

This seems to be caused by a KeyError. From the logs:

Internal Server Error: /cms/pages/27553/edit/
Traceback (most recent call last):
File "/app/dockerpythonvenv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail/admin/urls/init.py", line 173, in wrapper
return view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail/admin/auth.py", line 167, in decorated_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail/admin/views/pages/edit.py", line 375, in dispatch
response = self.run_hook("before_edit_page", self.request, self.page)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail/admin/views/generic/mixins.py", line 49, in run_hook
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail_localize/wagtail_hooks.py", line 277, in before_edit_page
return edit_translation.edit_translation(request, translation, page)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail_localize/views/edit_translation.py", line 654, in edit_translation
location_info = get_segment_location_info(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dockerpythonvenv/lib/python3.11/site-packages/wagtail_localize/views/edit_translation.py", line 422, in get_segment_location_info
block_field = block_type.child_blocks[block_field_name].label
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'URL'This suggests that the translations were not synced when the data migration was done for #11954 ( https://github.com/MozillaFoundation/foundation.mozilla.org/pull/11954/files )

@data-sync-user
Copy link
Collaborator Author

@data-sync-user
Copy link
Collaborator Author

➤ Jhonatan Lopes commented:

Confirmed that the fix works on staging: https://foundation.mofostaging.net/cms/pages/27553/edit/ ( https://foundation.mofostaging.net/cms/pages/27553/edit/ )

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

1 participant