Page MenuHomePhabricator

PagePreviews do not show for additional content namespace links
Open, MediumPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

  • An error is reported: "There was an error displaying this preview"

What should have happened instead?:

  • The preview should have shown

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
See also: https://meta.wikimedia.org/w/index.php?title=Community_Wishlist_Survey_2022/Reading/Page_Previews_show_an_error_message_on_all_links_to_Anexo:_namespace_in_Spanish_Wikipedia&action=edit

Seems that https://es.wikipedia.org/api/rest_v1/page/summary/Anexo%3ADivisi%C3%B3n_pol%C3%ADtica_de_Am%C3%A9rica is not returning an extract but the TextExtracts extension is: https://es.wikipedia.org/wiki/Especial:Zona_de_pruebas_de_la_API#action=query&format=json&prop=extracts&titles=Anexo%3ADivisión%20pol%C3%ADtica%20de%20América

Thus this is an error in the rest api

Event Timeline

TheDJ updated the task description. (Show Details)

I'm tagging Page content service, though I'm not sure that is correct. But its hard to figure out what software is responsible for what parts of the rest api.

The issue is this line:
https://gerrit.wikimedia.org/g/mediawiki/services/mobileapps/+/1d43564574963a56842798e594f971b79e220855/lib/summary.js#12
https://gerrit.wikimedia.org/g/mediawiki/services/mobileapps/+/1d43564574963a56842798e594f971b79e220855/lib/summary.js#55

I think summaries should likely be enabled of all namespaces. This would be useful on mediawiki.org for example. It should be up to the client to decide whether to use them or not.

I think it's actually further back than that. Page previews was never intended for non-main namespaces, so it was never implemented and the concern was that certain namespaces would not work well e.g. consider a JSON or Wikisource book namespace.

At this point, I think it makes sense to expand this to several namespaces that community have expressed a desire to use e.g. Skin and Extension on mw.org and MediaWiki namespace as is suggested here.

I think it makes sense to expand this to several namespaces that community have expressed a desire to use e.g. Skin and Extension on mw.org and MediaWiki namespace as is suggested here.

I agree.


It's been noted elsewhere that extending Page Previews could be made easier/more MediaWiki-like. I think that this could be a good opportunity to fix this. However, this would dramatically increase the scope of this task and so should probably be done before or soon after this change – otherwise we'll find ourselves with too many Page Previews summary generators to port!

The short version is:

  1. We port the summary generation code to PHP
  2. We allow extensions to register their own summary generation code via MediaWiki's extension attributes
  3. We expose the above via MediaWiki's RESTful API framework
SLopes-WMF triaged this task as Medium priority.Jul 8 2022, 9:45 AM