Topic on Project:Support desk

Hook SkinBuildSidebar not working in MW_1_35

14
Goodman Andrew (talkcontribs)

What I did:

$wgHooks['SkinBuildSidebar'][] = function($skin, &$bar) {
        $out = <<< EOT
<iframe src="//rcm-na.amazon-adsystem.com/e/cm?o=1&p=29&l=ur1&category=software&banner=0FNP2ZP63JZJBWQRD082&f=ifr&linkID=ea3dcccece96f5ba66814f531937489c&t=example-20&tracking_id=example-20" width="120" height="600" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
EOT;
        $out .= "<script>$('#p-Ads').addClass('persistent');</script>";
        $bar['Ads'] = $out;
        return true;
};

The intended ads isn't showing.

even the following example has no effect on the wiki in question:

$wgHooks['SkinBuildSidebar'][] = function( $skin, &$bar ) {
	$bar['navigation'][] = [
		'text'  => $skin->msg( 'wikimediashoplink-linktext' ),
		'href'  => '//shop.wikimedia.org',
		'title' => $skin->msg( 'wikimediashoplink-link-tooltip' ),
		'id'    => 'n-shoplink',
	];
};

Please advise.

MarkAHershberger (talkcontribs)

Which skin are you using?

Goodman Andrew (talkcontribs)

@MarkAHershberger: Default skin Vector on desktop and Minerva Neu on Mobile Frontend.

Any trouble that might caused?

@Bawolff: what can you say about this ?

Bawolff (talkcontribs)

I can say that Mark is correct.

Goodman Andrew (talkcontribs)

Maybe it's MW_1_35 ish because this code works on the default vector skin on 1_33 before we upgraded MW.

Can anyone with MW_1_33 please confirmed this?

MarkAHershberger (talkcontribs)

The SkinBuildSidebar hook is invoked by the skins, so the skin you are using matters. I would have to look more closely to tell you any more.

Goodman Andrew (talkcontribs)

Good. Please carefully experiment from your end because even the examples at the hook page didn't have any effect on the wiki in question.

MarkAHershberger (talkcontribs)

I am not sure I really have time to look at your issue.

However, one thing you said makes me wonder: Are you using the version of the Vector skin that comes with MediaWiki 1.35 or are you still using the 1.33 version of Vector?

Goodman Andrew (talkcontribs)

This is not funny. Everyone knows that when you update MW you need to update all extensions as well.

Why would someone use an old skin on a new MW?

@Ammarpad: please help me out here.

Ammarpad (talkcontribs)

I am not sure what to say apart from what has been said. If you think there's a bug, you can file a bug report

Goodman Andrew (talkcontribs)

Please I need someone to also test that code from her end and see if it works.

Have anyone tested already?


Even though I increased the size of the sidebar to comfortably accommodate a 120x600 (vertical) banner and even a 160x600, it still doesn't work:

/* All CSS here will be loaded for users of the Vector skin */

/* increase Vector sidebar width to accommodate ads */
div#mw-panel { width: 12em; }
div#p-Ads div.body {margin: 0em !important; }
div#footer, #mw-head-base, div#content { margin-left: 12em; }
#left-navigation { margin-left: 12em; }
Goodman Andrew (talkcontribs)

I've confirmed it with MW_1_33, it works. There's a bug🐜 that's preventing it from working in 1_35.

Please someone should help report the bug to the correct quarters.

Thank you.

MarkAHershberger (talkcontribs)

You can report the bug with what you've found using your MediaWiki.org login on phabricator.

Goodman Andrew (talkcontribs)

@MarkAHershberger: Please help me; there are just too many things in my plate this time. Please help me. Besides, my bug report never made any impact, check my history or see Template:T:267132 for example.

Reply to "Hook SkinBuildSidebar not working in MW_1_35"