Open leewesleyv opened 9 months ago
Hey @leewesleyv, Thank you for reporting this. Which versions of wagtail-localize/Wagtail are you on?
@zerolab
Currently using the following versions:
wagtail==5.2.3
wagtail-localize==1.7
Besides these versions I've tried with main (of wagtail-localize
) where the problem also seems to be present.
Does running the ./manage.py fixtree
help?
@danthedeckie Running that command will indeed find and fix the problem (see 4th screenshot in https://github.com/wagtail/wagtail-localize/issues/773#issue-2114412105).
By way of update: I was hoping to get to it last week, but I didn't get to it, sorry!
I was able to replicate this. Working on a fix
Naively wondering if we can effectively run fixtree
after the page copying process has run. Will see if I can make time to address it this way, as this is a blocker for us and I'm happy to help
Rummaging around, trying to pinpoint where the page tree goes awry.
I slotted in a call to wagtail.management.commands.fixtree.Command().handle()
just a the end of form_valid to see if that would spot any issues with the tree just after the translations were made.
It appears not:
> /Users/steve/Code/wagtail-localize/wagtail_localize/views/submit_translations.py(164)form_valid()
-> ft_func()
(Pdb) ft_func()
Checking page tree for problems...
No problems found.
Checking page tree for problems...
No problems found.
Checking collection tree for problems...
No problems found.
INFO 2024-10-14 07:47:57,950 signal_handlers Creating redirects for page: 'REDACTED base route' id=45
INFO 2024-10-14 07:47:57,978 signal_handlers 0/0 redirects were created successfully.
INFO 2024-10-14 07:47:57,991 publish_revision Published: "REDACTED base route" pk=45 revision_id=156
INFO 2024-10-14 07:47:58,003 publish_revision Published: "Hello, World" pk=50 revision_id=158
INFO 2024-10-14 07:47:58,067 publish_revision Published: "test parent page" pk=51 revision_id=160
INFO 2024-10-14 07:47:58,082 publish_revision Published: "child of parent page" pk=52 revision_id=162
So now it's off to deeper in the stack, possibly in core wagtail(?)
If anyone else knows where this is being caused, please do say 😄
Thank you for the investigation @stevejalim Added to my list for this week.
When translating a page through the Wagtail admin (localize/submit/page/) and including the subtree, the (translated) page tree is corrupt. The
numchild
value for the translated page stays 0, which causes the subpages to not appear in the Wagtail admin. I've been able to reproduce this on multiple Wagtail instances.How to reproduce
On a fresh installation of Wagtail (using
wagtail start
), configure i18n using the Wagtail docs. Installwagtail-localize
following the installation guide. Then perform the following actions: