Page MenuHomePhabricator

Reduce Page Images queries count for MobileFrontend watchlist page
Closed, ResolvedPublic


MobileFrontend SpecialMobileEditWatchlist file has flawed logic when it comes to retrive the PageImages.

The executeViewEditWatchlist() function first calls a SpecialMobileEditWatchlist::images hook to retrieve all page images for current query (PageImages extension listens to that hook and returns an array of images), then for each Article it:

  • if the image exists in the $images array - use it
  • otherwise call PageImages::getPageImage() to get the image

Most probably the call to the PageImages is not necessary, as we already asked PageImages for image for given article and it just doesn't exist. There is no need to do the SQL query once again.

Is there any special case, where we have to execute PageImages::getPageImage()? If no, we should get rid of that code.

Event Timeline

Change 474958 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@master] SpecialMobileEditWatchlist shouldn't query PageImages extension twice

Change 474958 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] SpecialMobileEditWatchlist shouldn't query PageImages extension twice

phuedx claimed this task.
phuedx subscribed.

Being bold.

Being bold.

Dependency has been dropped from MobilePage, should be fine :)