Page MenuHomePhabricator

addPortletlink is broken on is.wikibooks
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Add the following code to your common.js page on is.wikibooks.org and preview it
function makeDownloadLink() {
    	mw.util.addPortletLink(
    	  "p-tb",
    	  "https://commons.wikimedia.org/wiki/Special:UploadWizard?uselang=is",
    	  "Upload",
    	  "t-upload",
    	  "Upload a a file"
	    );
}
$( makeDownloadLink );
  • Observe that a 'Upload' link is not added to the sidebar
  • Try changing 'p-tb' to the other portals; "p-cactions", "p-navigation" (did not test 'p-personal')
  • Observe that those do not work either.

What happens?:
Adding a addPortletLink on an javascript page does not add the requested link to the requested portal.
The code does work on other WMF projects, like is.wikipedia.org.
No errors are in the browser console related to this issue.

Might have been caused by the deployment of T360431 (hence the Mediawiki-releasing tag)

What should have happened instead?:
The link to the requested portal should have been added

Software version (skip for WMF-hosted wikis like Wikipedia):
WMF

Other information (browser name/version, screenshots, etc.):
Firefox 123.0

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

mw.util.addPortletlink is working fine on it.wikibooks.org, however, one the site styles from the MediaWiki:-namespace on your wiki, are making both yours and the original one, invisible.

#t-upload {
  display: none;
}

Screenshot 2024-03-29 at 11.27.12.png (2,047×1,536 px, 600 KB)

Fixed on wiki. Thanks for the information.