Page MenuHomePhabricator

Title displayed for Main Page when loaded via search
Closed, ResolvedPublic

Description

You should get the same view as on http://test.m.wikipedia.org/ with the special-cased sections and titles. Instead you get a plain view of the page, with 'Main Page' as the title etc.

We should either get the expected special-case data back from the API when we AJAX-load it, or we should special-case the search to not AJAX-load the main page.

Probably low priority as few people will be searching the main page though.


Version: unspecified
Severity: normal

Details

Reference
bz41290

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:08 AM
bzimport set Reference to bz41290.

Sounds like an issue with the API
I've seen this in the app too.

Should the API return the special cased content or the entire content?

OK this is also problematic when you search for Special:Watchlist or Special:MobileMenu

Ideally we should only load content dynamically from the article namespace, however currently the json returned by the api for a search gives no indication of the namespace...

Two options:

  1. Limit search to just cover the article namespace? Seems a bit unfortunate that we prevent searching for special pages etc but at least this wouldn't cause any surprises (I assume here that the Main page is not in the article namespace)
  1. Update api response to include indication of namespace - this would allow us to only enhance certain search results - when clicking a search we would navigate to the page rather than attempting to dynamically load
  1. Disable all dynamic loading of search results - this solution sucks but might be the easiest.

I've just submitted https://gerrit.wikimedia.org/r/36312 - this attempts to load the page via ajax and if it fails it resorts to loading the url instead.

My suggestion would be to make the Main Page return an error when requested via this method of the api. This is probably a good idea as the main page renders incorrectly in the app when requested in a similar fashion.

CLARIFICATION:

The result has the heading "Main Page" which is inconsistent to the initial page.

Change merged to master. The change helped with searching for 'Main Page', but the behavior in conjunction with the 'random page' feature is a little weird. If the Main Page ashn't been configured yet, it is now unclear when using 'Random' if you are on the main page as the title text is changed to 'This homepage needs to be configured'.

Can you get to the main page via random? That seems rather strange..

(In reply to comment #7)

Can you get to the main page via random? That seems rather strange..

I can locally. What is strange about that?

Does the main page come up as a result of clicking random? Just trying to understand the problem here.

(In reply to comment #9)

Does the main page come up as a result of clicking random? Just trying to
understand the problem here.

It can and does for me, at least on my local instance - both on mobile and desktop views.

Opened bug 42663 to capture this new issue.