Page MenuHomePhabricator

Complex page move leaves some translation-related pages behind
Closed, ResolvedPublic

Description

Recently, I moved [[m:Grants:Learning patterns]] to [[m:Learning patterns]] and [[m:Grants:Evaluation]] to [[m:Learning and Evaluation]]. Each are translatable pages with an extensive collection of subpages, many of which are also translatable.

In general, the page move occurred without incident.

However, certain translation related pages (possibly all of them, or possibly just a subset) were not moved. They are tracked here:

Event Timeline

Harej created this task.Jun 21 2017, 11:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 21 2017, 11:18 PM
Harej added a comment.EditedJun 23 2017, 1:58 AM

A new batch of pages affected by this:

Programs:Training/Survey Design/ar
Programs:Training/Survey Design/arz
Programs:Training/Survey Design/bg
Programs:Training/Survey Design/en
Programs:Training/Survey Design/fr
Programs:Training/Survey Design/it
Programs:Training/Survey Design/ja
Programs:Training/Survey Design/ko
Programs:Training/Survey Design/lb
Programs:Training/Survey Design/oc
Programs:Training/Survey Design/pt-br
Programs:Training/Survey Design/ru
Programs:Training/Survey Design/tr
Programs:Training/Survey Design/uk
Programs:Training/Survey Design/zh

I'm definitely seeing a pattern here. A page will be moved successfully, and its translation subpages will be moved successfully, and its other subpages will be moved successfully, but the translation subpages of the other subpages won't.

If an example will help here: Imagine I have a page, [[Super Portal]]. The page is translatable and has a translation subpage, [[Super Portal/en]]. Because it is a portal it also has a garden-variety subpage, [[Super Portal/News]]. That page is also marked for translation, leading to [[Super Portal/News/en]]. If I rename [[Super Portal]] and all subpages, it will rename [[Super Portal]], [[Super Portal/en]], [[Super Portal/News]], but NOT [[Super Portal/News/en]]. That is what I believe is going on here.

Harej added a comment.Jun 23 2017, 5:50 PM

Trying to get around this first by moving the subpage and then moving the parent page is a terrible idea, it turns out, since doing the former prevents the latter.

Nikerabbit triaged this task as High priority.Jun 27 2017, 5:54 AM
Harej added a comment.Jun 27 2017, 9:12 PM

Workaround: copy the contents of the Translations-space pages to their new corresponding titles (try to give credit to the original translator via edit summary), make the old translation subpages redirect to the new ones, delete the old Translations. This is undesirable but it works.

Harej added a comment.Jun 27 2017, 9:25 PM

I think this bug has been reported before... T114592

I think this bug has been reported before... T114592

Yes, the other problem being redirects.

Perhelion added a comment.EditedJul 26 2018, 8:57 AM

Trying to get around this first by moving the subpage and then moving the parent page is a terrible idea, it turns out, since doing the former prevents the latter.

I don't understand your claim, as this would be the simplest solution for this bug. The parent page blocks the move of the subpages, so move the parent page at last. It's no fun to move 20 pages by hand. Therefore I do not advertise anymore to use this extension.

abi_ added a subscriber: abi_.Mar 23 2020, 2:50 PM

Tested this on my local,

  1. Created a page T168591, marked it for translation and translated it to en-gb, fr, es.
  2. Created a page T168591/Hello, marked it for translation and translated it to en-gb, fr, it.
  3. Moved page T168591 --> T168591-2

Observation: T168591/Hello was left untouched and it, and its translations were accessible at the previous URL itself.

See screenshot -

Even non-translatable sub pages are not moved, hence the option to Move subpage does not make sense. Looking at the code though, it looks like normal subpages should be moved.

		if ( $this->moveSubpages ) {
			$subpages = $this->getNormalSubpages();
			foreach ( $subpages as $from ) {
				$to = $this->newPageTitle( $base, $from, $target );
				$moves[$from->getPrefixedText()] = $to->getPrefixedText();
			}
		}

Coming back to the first case, I then tried to move T168591/Hello ---> T168591-2/Hello, and was able to do so successfully.

So the only issue I see here is that, when the Move sub page option is selected, the non-translatable sub pages should be moved, and they currently aren't.

Change 587710 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] MovePage: Don't show subpages when move subpages is not selected

https://gerrit.wikimedia.org/r/587710

abi_ added a comment.Apr 9 2020, 11:01 AM

Made a few tweaks to the way SpecialTranslationMovePage works based on the sub page option selected,

If the Move subpage option is not selected, we are no longer showing those sections,

In addition if the move sub page option is selected but there are no sub pages, then showing the user a message,

Change 588685 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] DeletePage: List subpages for deletion everytime

https://gerrit.wikimedia.org/r/588685

Change 588685 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] DeletePage: Display subpages without strikethrough

https://gerrit.wikimedia.org/r/588685

Change 587710 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] MovePage: Remove subpage option when checking if move is possible

https://gerrit.wikimedia.org/r/587710

Change 593533 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] MovePage: update help link to point to Move translatable page doc

https://gerrit.wikimedia.org/r/593533

Change 593533 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] MovePage: update help link to point to Move translatable page doc

https://gerrit.wikimedia.org/r/593533

Following changes have been made for,

Delete and Move translatable page

To make the functionality of both these pages similar, we've done the following,

  1. Remove the sub page option when selecting the page to be deleted / moved.
  2. When displaying a list of pages to be deleted / moved, display all the pages including the sub pages.
  3. On the second step, allow user to select an option to delete or move the sub pages if they want.
  4. Add a count to display the number of sub pages that are going to be deleted / moved separately.
  5. If no sub pages are present, a message is displayed that there are no sub pages to be deleted or moved.

In Move translatable page, we've made the existing notice, that displays that translatable sub pages have to be moved separately, bold.

Documentation for the move translatable pages has been added here, and linked to, from the Special page.

abi_ closed this task as Resolved.May 14 2020, 1:02 PM

This has been deployed and tested on MediaWiki.