You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The menu item for "translate this page" from the parent of a translation alias page shows the incorrect URL, a localize/submit/page/<id>/ with the ID of the translation alias page, rather than the original page.
Trying to translate via that URL seems to break things, either producing "Spanish -> Spanish" translations, or ending up with the new page no longer being editable at all.
Including the subtree can result in even more weirdness.
Screenshots showing our setup & the URLs:
Here's what we see (note the URL) when we go to translate from the English (original) parent view (when hovering "Translate this page")
Or if you clicked "Edit" on the page in the spanish page tree, you could then go to translate it, with basically the same URL:
The page ID in the URL is the original page ID.
Here's what we see (note the URL) when doing the same from the Spanish parent page:
Note that the page ID in the URL is of the translation alias page, NOT the original!
On the older version (1.5.2) of wagtail_localize that would seem to work - but then end up with Spanish > Spanish
and then if child-pages and subtrees got involved, it would end up crashing and getting really confused, often resulting in the pages no longer being editable (the MultipleObjectsReturned ones).
Upgrading to 1.7, things are now a bit different. You still get the different URLs, and using the URL based on the original (english) page seems to work OK.
But using the URL based on the Spanish page results in the page now no longer being editable at all:
Here's the traceback on that, btw:
Traceback (most recent call last):
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail/admin/urls/__init__.py", line 170, in wrapper
return view_func(request, *args, **kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail/admin/auth.py", line 186, in decorated_view
response = view_func(request, *args, **kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail/admin/views/pages/edit.py", line 349, in dispatch
response = self.run_hook("before_edit_page", self.request, self.page)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail/admin/views/generic/mixins.py", line 28, in run_hook
result = fn(*args, **kwargs)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail_localize/wagtail_hooks.py", line 277, in before_edit_page
return edit_translation.edit_translation(request, translation, page)
File "/Users/daniel/.virtualenvs/testproject/lib/python3.10/site-packages/wagtail_localize/views/edit_translation.py", line 912, in edit_translation
"source_translation": [
Exception Type: IndexError at /en/admin/pages/745/edit/
Exception Value: list index out of range
The text was updated successfully, but these errors were encountered:
Thank you for the detailed issue report @danthedeckie
Will try to look into it this ASAP (but may be a bit as I don't currently have any active projects using localize 🙊). As always, happy for a PR if you happen to have the time.
Summary
The menu item for "translate this page" from the parent of a translation alias page shows the incorrect URL, a
localize/submit/page/<id>/
with the ID of the translation alias page, rather than the original page.Trying to translate via that URL seems to break things, either producing "Spanish -> Spanish" translations, or ending up with the new page no longer being editable at all.
Including the subtree can result in even more weirdness.
Screenshots showing our setup & the URLs:
Here's what we see (note the URL) when we go to translate from the English (original) parent view (when hovering "Translate this page")
Or if you clicked "Edit" on the page in the spanish page tree, you could then go to translate it, with basically the same URL:
The page ID in the URL is the original page ID.
Here's what we see (note the URL) when doing the same from the Spanish parent page:
Note that the page ID in the URL is of the translation alias page, NOT the original!
On the older version (1.5.2) of
wagtail_localize
that would seem to work - but then end up with Spanish > Spanishand then if child-pages and subtrees got involved, it would end up crashing and getting really confused, often resulting in the pages no longer being editable (the
MultipleObjectsReturned
ones).Upgrading to 1.7, things are now a bit different. You still get the different URLs, and using the URL based on the original (english) page seems to work OK.
But using the URL based on the Spanish page results in the page now no longer being editable at all:
Here's the traceback on that, btw:
The text was updated successfully, but these errors were encountered: