Page MenuHomePhabricator

Special:PageMigration - Page search suggestion does not work
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce

  1. Open Special:PageMigration
  2. Search in the Textbox for the name of a page

Expected behavior

Pages starting with a similar name should be shown in the suggestion box.

Actual behavior
No suggestion box appears, and an error is logged in the console.

Additional info
Here's the error logged in the console,

Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at getFormData (searchSuggest.js?ed05e:54)

This is happening because our HTML Form does not have an action attribute and getFormData expects an action attribute. See code from that function below,

baseHref = $form.attr( 'action' );
baseHref  = baseHref.indexOf( '?' ) > -1 ? '&' : '?';

This seems to be only used for tracking purposes.

Couple of things could be done to fix this,

  1. Add an empty action attribute to the form in SpecialPageMigration.php
  2. Add a check in getFormData before doing indexOf ... which I think we should do either way.

Event Timeline

abi_ triaged this task as Medium priority.Mar 6 2019, 7:39 AM
abi_ created this task.

Change 496233 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix page suggestion not working on Special:PageMigration

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

There were two issues here,

  1. When typing the name of the page, the suggestion dropdown was not visible. This was because the searchSuggest plugin expects the parent form to have an action attribute and this was missing for the form on the Migration page.
  2. Once the above issue was fixed, noticed that clicking on the suggestions would redirect the user.

Fixed the first issue by adding an empty action attribute to the form. The second was fixed by adding data-mw-searchsuggest="{ "wrapAsLink": false }" to the suggestion box input.

Note that there is an existing issue T217727: Special:PageMigration - "query - messagecollection" API throws an error due to which clicking on the import button will not do anything.

Test Case


Please find the test case below,

TC #1 - Suggestion box should display the list of pages with similar name

  1. Open the Special:PageMigration
  2. Start typing the name of the page that you know exists in the Wiki.
  3. Click on any one of the pages that appears in the suggestion list.

Expected Behavior

After step 2, you should see the suggestion box appear. On performing step 3, no redirection should occur and the clicked page name should simply get populated in the textbox.

Change 496233 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix page suggestion not working on Special:PageMigration

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

Niklas noticed an issue with the searchSuggestion plugin when using the Timeless skin. I've reported it here - T218565: Search suggestion appears in the same location for all searchSuggestion instances

I have confirmed this on dev.translatewiki.net. With latest changes to Timeless, the dropdown is also correctly positioned.

There is some possible issue that nothing seems to happen on invalid input when submitting the form.

There is some possible issue that nothing seems to happen on invalid input when submitting the form.

@Nikerabbit - What sort of invalid input? I'm seeing an error message pop up above the page title textbox based on what sort of invalid input I enter.

Specifically the case of a page with a language code which is not a translatable page seems to not cause any message at all. (For example MediaWiki:Jan/fi assuming that the page exists).

I'm seeing the following -

image.png (355×735 px, 13 KB)

Here T217726_1/fi is a page that exists, but is not translatable.

Can you reproduce the issue at https://translatewiki.net/wiki/Special:PageMigration with MediaWiki:Jan/fi as input?

Can you reproduce the issue at https://translatewiki.net/wiki/Special:PageMigration with MediaWiki:Jan/fi as input?

Hi @Nikerabbit - Sorry for the delayed response. I do not have permissions to the migration page. Requires Bureaucrat permissions.

Bureaucrat is a user group. The right is is pagetranslation.

Change 736013 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] PageMigration: Handle invalid group when fetching translation units

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

Change 736013 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] PageMigration: Handle invalid group when fetching translation units

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

Nikerabbit removed a project: Patch-For-Review.

Did not pass QA. Still an issue with message groups that are not translatable pages.

Change 740195 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] PageMigration: Handle message groups that are non translatable pages

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

Change 740195 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] PageMigration: Refactor code to make error handling simpler

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

This is fixed. Tested on Translatewiki.net

Eg 1:

image.png (253×588 px, 15 KB)

Eg 2:

image.png (243×637 px, 15 KB)