-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unbreak Page Preview Feature: WMF broke Page Previews by making PCS private #120
Comments
Popups Gadget as alternativeAvailable for WMF projects ONLY
|
Tried these configs to no avail while researching the state of brokenness. wfLoadExtension( "PageImages" );
wfLoadExtension( "EventLogging" );
wfLoadExtension( "Popups" );
// Don't hide the preference
$wgPopupsHideOptInOnPreferencesPage = false;
$wgPopupsOptInDefaultState = '1';
$wgPopupsReferencePreviewsBetaFeature = false;
// turn off Parser HTML comment
$wgEnableParserLimitReporting = false;
// Use as much as possible for Text Extracts
$wgPopupsTextExtractsIntroOnly = false;
// Do not avoid certain pages and tags
$wgExtractsRemoveClasses = [];
// Use the TextExtracts extension for PopUps
$wgPopupsGateway = 'mwApiPlain'; |
Surprisingly, using an empty array for In order to see the effect of any code change, I had to restart php-fpm so that PHP changes would be interpreted, and also restart memcache so that new values for the extract would be computed. TLDR;Add any of the lines below to the TextExtracts extension configuration in 'LocalSettings.php' (or equivalent file). $wgExtractsRemoveClasses = '';
$wgExtractsRemoveClasses = null;
$wgExtractsRemoveClasses = false; |
TextExtracts Code changes between 1.35 and 1.39wikimedia/mediawiki-extensions-TextExtracts@wmf/1.35.0-wmf.30...wmf/1.39.0-wmf.28 New changes since 1.39 to masterwikimedia/mediawiki-extensions-TextExtracts@wmf/1.39.0-wmf.28...master |
Parser Limit reportIn the page source, there is an HTML comment output like the following: <!--
NewPP limit report
Complications: []
[SMW] In‐text annotation parser time: 0 seconds
--> And that's when the feature is turned OFF with If the report were actually generated, it would look more like this: <!--
NewPP limit report
Cached time: 20241107144457
Cache expiry: 86400
Reduced expiry: false
Complications: []
[SMW] In‐text annotation parser time: 0 seconds
CPU time usage: 0.112 seconds
Real time usage: 0.114 seconds
Preprocessor visited node count: 1/1000000
Post‐expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 1/100
Expensive parser function count: 0/100
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 0/5000000 bytes
ExtLoops count: 0/100
-->
<!--
Transclusion expansion time report (%,ms,calls,template)
100.00% 0.000 1 -total
--> Regardless of the content, it is the only content picked up by the TextExtracts extension without overriding the IOW, you get an HTML comment (not visible to the user)
instead of a usable visible extract like this:
from |
Note about Page ImagesIf doing a wiki migration (e.g. creating a new wiki from a DB dump) instead of starting from scratch, you will need to initialize the "Page Images" property for all your existing pages. For instance, we ran the following on a Meza migration of the 'wiki' wiki. |
This isn't really fixed - yet. Not satisfied with unsetting When you attempt to add/edit These are the default removals. |
The Page Preview feature (also called 'Popups') gives a thumbnail representation of a page when the reader hovers the mouse over a hyperlink to a wiki article. WMF took this feature out of the (internal) MediaWiki REST API and created a separate Wikimedia REST API called RESTBase PCS (Page Content Service) which is only available to WMF projects - not third-party wikis.
Because of this, independent wikis have started to demonstrate a loss of functionality going back to ~2022 and MediaWiki 1.38
In 2024, using MediaWiki 1.39 the Text Extracts extension returns the output of the Parser Limit Reporting HTML comment. Even if you turn off Parser Limit Reporting, there is still nominal output and it's the only thing "found" by the Text Extracts extension. (details below)
For most links, Text Extracts generates a misleading error message "There was an issue displaying this preview" when it really means that the extract is empty.
The endpoint in PCS needed for Page Previews is the 'page summary'.
The text was updated successfully, but these errors were encountered: