When asking a question about a preview not displaying please ensure to include information on the wikitext of the first section of the target page (markup before first heading double equals signs) and the network request.

Reference prewiews

edit

Please can someone help me.

I have installed: Extension:TextExtracts, Extension:PageImages and Extension:Popups.

The gadgets Navigation popups and Reference Tooltips are not allowed.

Page previews work as expected, but reference previews do not.

Local Settings:

wfLoadExtension( 'Popups' );

$wgPopupsReferencePreviews = true;

$wgPopupsOptInDefaultState = '1';

How to solve this problem? Kastanipuu (talk) 09:53, 17 February 2023 (UTC)Reply

Pop-up works but...

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Pop-up works but it displays nothing but "There was an issue displaying this preview". 188.149.42.241 (talk) 22:47, 3 March 2023 (UTC)Reply

Please provide more context, or direct links to specific examples, so that people can understand where the issue is (which wiki, which page, etc) and try to replicate it, or provide other relevant advice or pointers. Thanks. Quiddity (WMF) (talk) 23:16, 3 March 2023 (UTC)Reply
Sorry...
I think it's solved now though. The page cannot start with ==TEXT== and images are not drawn from the gallery code. So for those that might have the same problem, your page should start with just some text, maybe a short description depending on what you're making, before starting to put in headings. And there have to be at least one image that is not inside a gallery tag. 188.149.42.241 (talk) 23:54, 3 March 2023 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Do we need to installed Required-Dev libraries

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


In the Popups Extension composer.json file stated -

"require-dev": {

"mediawiki/mediawiki-codesniffer": "39.0.0",

"mediawiki/mediawiki-phan-config": "0.11.1",

"mediawiki/minus-x": "1.1.1",

"php-parallel-lint/php-console-highlighter": "1.0.0",

"php-parallel-lint/php-parallel-lint": "1.3.2"

Does it means that we need to run the composer install to install these libraries as well?

It seems that the Extension is working without these libraries ?

What are the impact if we installed it ? Lotusccong (talk) 11:05, 12 April 2023 (UTC)Reply

"dev" here means "for development" and is only needed when you want to make changes to the code of the extension. Also see https://getcomposer.org/doc/04-schema.md#require-dev. Thiemo Kreuz (WMDE) 13:24, 12 April 2023 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.
edit

MW with 1.39.3, PHP 8.0.28, SMW 4.1.1 , TextExtracts – (74baaa7) 17:23, 20 March 2023 , Previews – (010237d) 15:23, 21 March 2023, PageInages – (78537e6) 15:23, 21 March 2023 .

If you access this webpage https://www.tbpedia.org/wiki/%E7%9B%A7%E5%8B%9D%E5%BD%A5%E6%96%87%E9%9B%86%E7%BF%BB%E8%AD%AF%E7%B6%AD%E5%9F%BA%E9%A4%A8

There are 5 links to the internal pages but only one ( Item 5 Main Page link) can successfully showed the preview.

I have this intermitted issues where sometime the preview work, sometime it failed.

When I run the TextExtract https://www.tbpedia.org/w/api.php?action=query&prop=extracts&exchars=1000&titles=%E9%A6%96%E9%A0%81

Sometime it can extract the text , sometime it will failed with the message as below

"extract": "<!-- \nNewPP limit report\nCached time: 20230412130639\nCache expiry: 86400\nReduced expiry: false\nComplications: []\n[SMW] In\u2010text annotation parser time: 0.001 seconds\nCPU time usage-->..."


It is due to the cache , extension conflict ?

Yet to figure out what is the root cause ? It is due to TextExtract extension issue or Popups extension issues or other extension / libraries that caused the intermitted preview failed issue.

I had enable the debugtoolsbar but have no knowledge to troubleshoot it.

Any clues to fixed it ? Lotusccong (talk) 13:39, 12 April 2023 (UTC)Reply

Position of image

edit

Images in popups are automatically centered, how can I change this to align to the top? At least in my case, the heads of the characters are cut off very often due to centering, and when aligned to the top edge this would not happen. 5.53.113.93 (talk) 13:14, 22 April 2023 (UTC)Reply

No ideas? 5.53.113.93 (talk) 11:51, 23 April 2024 (UTC)Reply

stripping of line breaks

edit

Hi

on our company wiki we have a page for each user with their info (mail, room, phone etc.) in the top of the page.


The generated popups have the line breaks stripped from the info, which makes it hard to read


should look like this:

phone

room

mail

department


but does look like this:

phone room mail dep

artment


i spent hours fiddling with templates and modules to implement some kiond of padding with dots and/or invisible non-zero-length characters but have had no luck so far in making this work for all user (or even one)

I appreciate any kind of help

~~robert 146.52.159.94 (talk) 08:32, 10 May 2023 (UTC)Reply

I think there is currently no way to influence the formatting in the popup, except you make changes to the code of the Popups extension, and probably the TextExtracts extension as well. Since T233099 it should also be possible to inject new popup types from your own extension. Thiemo Kreuz (WMDE) 08:41, 10 May 2023 (UTC)Reply
Hi Thiemo, Thanks for the pointer.
I'm wondering what part of Popups would need to be changed. TextExtracts does include the br elements in the summary. Where do they get stripped?
~~robert 146.52.159.94 (talk) 09:50, 10 May 2023 (UTC)Reply

Popups in svg

edit

I noticed that popups don't work for links inside svg, for example made via Extension:ImageMap. Is this really the case, and is there any way to fix this? 5.53.113.93 (talk) 16:47, 25 May 2023 (UTC)Reply

Do you have a link to a page with such an SVG that I could take a look at? Phuedx (WMF) (talk) 14:08, 4 August 2023 (UTC)Reply

How to show text as shown in article

edit

It seems that the extension is hardcoded to show only the article title as bolded and the rest is plain text. However, I wish to have page previews similar to Wikipedia, where the bolded text is as shown in the article with contents in parenthesis is left out. Is there a means of getting this? Can this be done in MediaWiki:Common.css? If so, does anyone know a code? AKTC3 (talk) 18:14, 14 July 2023 (UTC)Reply

As of now this is intentionally hard-coded in the Popups extension as well as in the TextExtracts API that serves the text snippets. Thiemo Kreuz (WMDE) 14:51, 18 July 2023 (UTC)Reply

mw.user.sessionId() on page load detrimental to HTTP caching

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


This extension seems to call mw.user.sessionId() unconditionally whenever someone visits a page of the wiki, regardless of whether they're logged in or not.

The effect of this is setting the cookie mwuser-sessionId (usually prefixed with the wiki's database name), which means that the wiki visitor in question will not be served any cached HTTP content for any further pages they visit!

Wikipedia seems to have a workaround against this as far as I can tell by X-Cache HTTP headers I receive from it, though I couldn't find any documentation as to how it achieves this. A fairly typical Varnish or Nginx caching mechanism will not be accommodating against this, and thus suffer greatly. (In fact, it could be making the HTTP cache nearly useless, though I haven't made measurements; it might still be useful with SEO bots or such at least.)

Even the Varnish configuration recommended on Manual:Varnish caching is suspect to this issue, as the regex used to match session tokens will match mwuser-sessionId. (EDIT: This may be wrong after all; I had not thought about the equals sign at the end of the regex. Maybe that's the key.)

I wonder if this extension could be modified not to call mw.user.sessionId() for users that aren't logged in? FYI, the two places in the code that call this are src/actions.js:83 and src/instrumentation/statsv.js:23. TaylanKammer (talk) 22:53, 31 October 2023 (UTC)Reply

This sounds like an issue that should be reported on Phabricator. Can you do this? Thiemo Kreuz (WMDE) 16:18, 1 November 2023 (UTC)Reply
@TaylanKammer if you log a phabricator ticket using this bug template, we will have a look as soon as we can. VPoundstone-WMF (talk) 21:39, 2 November 2023 (UTC)Reply
@VPoundstone-WMF: Just FYI, that form is restricted. Thiemo Kreuz (WMDE) 09:06, 3 November 2023 (UTC)Reply
@TaylanKammer since the phab form is restricted, I will post the template here. Please write the ticket and tag Data Products. Thank you!
===Description
====Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)**
  • ...
====Observed behavior
  • ...
====Expected behaviour/Acceptance criteria (returned value, expected error, performance expectations, etc.)
  • ...
====Test environment info
  • ...
====Console logs
  • ...
====Screenshots
  • ...
===Completion checklist <To be filled in by assignee>
[] Regression tests covering this bug? [] Documentation updated and conforms to [|the accessiblity guide]? [] ... VPoundstone-WMF (talk) 16:18, 3 November 2023 (UTC)Reply
@VPoundstone-WMF Sorry for not getting back to this sooner. Here's the details. Please tell if more needed.
===Description
Enabling the Popups extension causes a session token to be assigned via JS, after any page is loaded, even for anonymous visitors.
This potentially degrades caching, since HTTP response headers for wiki pages tend to include Vary: Accept-Encoding, Cookie.
====Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)**
  • Disable the Popups extension in your LocalSettings.php file.
  • Open a private/incognito browser window or tab, and visit your wiki in it.
  • Use your browser's developer tools to confirm no cookies are stored yet.
  • Enable the Popups extension in your LocalSettings.php file.
  • Reload the visited wiki page in the browser window or tab from before.
  • Notice that a session cookie has now been stored by your browser.
====Observed behavior
  • Anonymous visitors get a session cookie as soon as they visit any wiki page; apparently through JS code, since the HTTP responses don't include any Set-Cookie headers.
====Expected behaviour/Acceptance criteria (returned value, expected error, performance expectations, etc.)
  • Anonymous visitors should not get a session cookie until they've performed some action that would actually require this, such as making an edit.
====Test environment info
====Console logs
  • None
====Screenshots
https://phabricator.wikimedia.org/T289780 Prod (talk) 21:57, 11 April 2024 (UTC)Reply
An update on this from my side: After taking a closer look at the recommended Varnish setup, it looks like the cookie mwuser-sessionId should not affect front-end caching, and I've been able to achieve something near identical with Nginx. The was indeed to only consider cookies matching the regexp ([sS]ession|Token)= with the equals sign at the end.
So, this issue with mwuser-sessionId being set would only affect a very naive front-end cache that's not fine-tuned for MediaWiki and looks at all cookies. TaylanKammer (talk) 12:17, 2 June 2024 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

How to selectively enable or disable popups for a page

edit

I have a wiki hosted by miraheze.org and I can enable popups, and they work, but I would like to be able to selectively enable or disable them for a page. I am going through the web-based menu and don't have MediaWiki downloaded.


Is there a way to enable or disable popups within a page's code? Dariusuknuis (talk) 14:31, 25 November 2023 (UTC)Reply

The documentation mentions $wgPopupsPageDisabled = [ 'Example' ];. Isn't this what you are looking for? Thiemo Kreuz (WMDE) 16:26, 26 November 2023 (UTC)Reply
Return to "Popups/2023" page.