Extension talk:CentralNotice

Error when DB_table names are prefixed
MySQL a renvoyé l’erreur « 1109 : Unknown table 'cn_notices' in where clause

when the tables are prefixed with fr_ as are all the tables in my wiki. FrViPofm 17:16, 7 March 2009 (UTC)
 * I have installed the extension on a wiki refixed tables with wiki_. Normally it works, there was an error in the table creation script which is fixed now. Can you try again to install CenralNotice? --194.114.62.123 09:52, 1 August 2014 (UTC)

Non-Wikimedia use?
Is this extension intended for non-Wikimedia use? It appears to ignore $wgDBprefix and to have the Wikimedia project names hard-coded. (Assuming that the instruction 2. Run central-auth.sql is a typo for 2. Run CentralNotice.sql) --MoreThings 19:34, 19 April 2009 (UTC)

how do you find out?
how do you find out if you have a "periodic scheduler (cron)"? Bud0011 08:25, 20 June 2009 (UTC)
 * You would probably need to ask your hosting provider. More info can be found at cron. Kaldari 17:11, 8 June 2010 (UTC)

um...where is this function?
So, i'm trying this extension out, and i get this error:


 * Fatal error: Call to undefined method SiteConfiguration::loadFullData in $IP/extensions/CentralNotice/SpecialNoticeText.php on line 213

but problem is, there's no "loadFullData" in any of the files .... is there? Bud0011 02:14, 11 August 2009 (UTC)

The same error:

 * Fatal error: Call to undefined method SiteConfiguration::loadFullData in /var/wwwpub/extensions/CentralNotice/SpecialNoticeText.php on line 213

What shall i do with it ? --Lugerr 11:20, 17 September 2009 (UTC)
 * For now, just disable the extension.... i guess....? Bud0011 21:17, 19 September 2009 (UTC)

loadFullData you find in the new Version von WM. 1.16. You can download that, and copy and paste it in the same .php

unable to make it work "(
when i write Run php maintenance/sql.php CentralNotice.sql in putty (in my wiki dir) it says X-Powered-By: PHP/5.2.14 Content-type: text/html

Warning: fopen(CentralNotice.sql) [function.fopen]: failed to open stream: No such file or directory in /home2/uetblogs/public_html/wiki/maintenance/sql.php on line 35

Unable to open input file and when i goto Special:CentralNotice it says, A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "CentralNotice::listNotices". Database returned error "1146: Table 'uetblogs_mdw1.mdw_cn_notices' doesn't exist (localhost)". i am a not a pro and wanted to have run CentralNotice active on my wiki. please help me.. whats wrong i am doing. Thanks --Adilch 09:28, 15 January 2011 (UTC)


 * I've changed the installation instructions so that the path should be correct. Give it another try. —Emufarmers(T 21:09, 15 January 2011 (UTC)
 * Thanks for simplifing things.. but i am still stuck... when i type "extensions/CentralNotice/CentralNotice.sql" it says "-bash: extensions/CentralNotice/CentralNotice.sql: Permission denied" where as Extensions dir already have 755 permission :( now what sir?? --Adilch 00:12, 16 January 2011 (UTC)


 * What you need to type is
 * —Emufarmers(T 05:43, 16 January 2011 (UTC)
 * i wrote the same what you suggested, now it says,
 * i wrote the same what you suggested, now it says,

Warning: fopen(extensions/CentralNotice/CentralNotice.sql) [function.fopen]: failed to open stream: No such file or directory in /home2/uetblogs/public_html/wiki/maintenance/sql.php on line 35

Unable to open input file --Adilch 21:53, 16 January 2011 (UTC)


 * You need to be running it from the wiki root (/home2/uetblogs/public_html/wiki/). —Emufarmers(T 07:29, 17 January 2011 (UTC)

How To Make Campaigns Appear?
Hi, I recently installed this extension, and I know it works because I've managed to setup site-wide banners once... but only once. As far as I understand, you make a banner, then set up a campaign (start time, end time, etc.), assign a banner to it, and then enable it.

I've set

$wgCentralDBname = 'my database name, as it appears in phpmyadmin';

$wgCentralPagePath = 'http://localhost/my wiki's name/index.php';

$wgNoticeProject = 'my wiki's name';

$wgNoticeProjects = array(	'my wiki's name', );

It's a vanilla version of mediawiki, with a localhost setup, nothing else added, just this extension, for the purpose of testing it out for my main wiki, but so far I haven't made much progress with it, and it seems like a really great extension. Can anyone help me figure out where I'm going wrong? --Pocket lint (talk) 21:50, 9 November 2012 (UTC)


 * Ack! I didn't watch this page until now so did not see your question -- did you manage to get CN working for you? Mwalker (WMF) (talk) 18:36, 14 January 2013 (UTC)

Invalid response from Extension Distributor remote client
Hi all, when i want to download this extension on the 1.1.19.0 version, i receive this error message. «Invalid response from Extension Distributor remote client.». Unfortunately I can't find any other way to find this version. anyone have an idea to resolve this problem ? Thank you. Robin - 15:35, 30 November 2012 (UTC)


 * I don't know the mechanics of Extension Distributor so I can't help you there -- and I don't believe we ever tagged a release of CN specifically for 1.19 -- if you're still interested in the extension and are still having this problem I would suggest emailing wikitech-l@lists.wikimedia.org or filing a bug about Extension Distributor. Alternately you can attempt to download the extension source directly from Git; but you will not be able to take HEAD. 1.19 does not have ContentHandler which CN now requires. Mwalker (WMF) (talk) 18:41, 14 January 2013 (UTC)

Database error
I am trying to use CentralNotice extension. After creating a banner at Central notice admin, when I click on the banner, it returns the following error:

Database error A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: from within function. Database returned error  in.

I would really appreciate your help. Thank you


 * Make sure you run the /maintenance/update.php script which will bring your tables up to date. Unfortunately the SQL file we ship with for initial files hasn't been updated in a while and the patch to fix this has yet to be approved. If you still have problems -- join us in IRC channel #wikimedia-dev and look for mwalker.


 * Yes I have run the /maintenance/update.php script from the server SSH command line. Still same error.

Thank you

Fatal error: Class 'ContentHandler' not found
I have installed the extension, and loaded the Special page. When I try to save a new banner, I get the error: Fatal error: Class 'ContentHandler' not found in /var/www/html/eduWiki/extensions/wikimedia-mediawiki-extensions-CentralNotice-7f493c5/special/SpecialNoticeTemplate.php on line 917

Any ideas what to do?

Versions: Product 	Version MediaWiki 	1.20.3 PHP 	5.4.13 (apache2handler) MySQL 	5.5.30 Thanks.

Hello, I've received the same error, if you figured it out please let me know how to fix it. Thanks Adel23uk (talk) 20:34, 29 April 2013 (UTC)


 * Greetings; I'm guessing you both are running CentralNotice master out of git? You may use the REL1_20 branch of CentralNotice which should solve your issue. If you still have issues please contact me. Mwalker (WMF) (talk) 17:55, 20 September 2013 (UTC)

Conflict with MobileFrontend extension
MobileFrontend extension stopped working, after installing CentralNotice extension.

Any idea? would be appreciated...


 * None that I can immediately think of; they run side by side here on the WMF cluster. Do you have any Javascript or PHP errors being thrown into the appropriate logs? Mwalker (WMF) (talk) 21:27, 28 January 2014 (UTC)
 * thanks for the quick response. Sorry, its the opposite, MobileFrontend is working, but CentralNotice isn't. No errors at all. The templates of CentralNotice are working when i view them in force preview, but otherwise not working at all. Strange.--78.43.43.42 23:38, 29 January 2014 (UTC)
 * Ah! OK; best thing to do then is to look and see if any content namespace page (any page served by Special:Random) is attempting to load Special:BannerRandom. That's the endpoint that your wiki will serve banners from. If it's making the request to the correct wiki, then you'll need to make sure that the 'project' parameter in the request URL (set by $wgNoticeProject) matches something valid in the $wgNoticeProjects array; and that you have a banner set to target that project. Check Special:BannerAllocation and Special:GlobalAllocation to see what banners the system things are live and where they're targeting. Hope that helps, if it doesn't; keep talking here or you can find me on IRC on freenode in #wikimedia-fundraising -- I'm mwalker. Mwalker (WMF) (talk) 00:01, 30 January 2014 (UTC)
 * Oh, wait -- CentralNotice stopped working after you installed MobileFrontend? Check to see if the 'device' parameter of Spceial:BannerRandom is set. It could also be that you need to enable CentralNotice on mobile which is controlled by the $wgMFEnableSiteNotice variable. Mwalker (WMF) (talk) 00:05, 30 January 2014 (UTC)
 * Thanks a lot for your comprehensive help. I will try everything and will give feedback here, as soon as possible. --78.43.43.42 22:53, 30 January 2014 (UTC)
 * So - what exactly do you mean by "set device parameter of Special:BannerRandom" ?--78.43.43.106 18:15, 2 February 2014 (UTC)
 * I should've asked before; what version of MediaWiki / CentralNotice / MFE are you running? When I integrated the two I added a 'device' selector to each banner -- see the 'Display On' header of [meta:Special:CentralNoticeBanners/edit/WP_BAnQ]. That gets exposed in a request URL like so: https://meta.wikimedia.org/wiki/Special:BannerRandom?uselang=en&sitename=Wikipedia&project=wikipedia&anonymous=false&bucket=1&country=US&device=desktop&slot=20 <-- the device=desktop bit. Mwalker (WMF) (talk) 18:29, 3 February 2014 (UTC)

Logs
Why does it log to some Special:CentralNoticeLogs instead of the usual Special:Log? πr2 (t • c) 16:33, 25 March 2014 (UTC)

Shared templates
Is it possible to share banners templates between different wikis ? i'am using wikifamilly to manage different languages and if i use shared database with wikifamilly i have to create the templates in the languages i want to display it, else i got an error (template content not found)

[f52a652c] /wiki_en/index.php/Special:CentralNoticeBanners/edit/bannerFr BannerContentException from line 812 of /opt/web/wiki/common/extensions/CentralNotice/includes/Banner.php: No content for banner: bannerFr Backtrace:
 * 1) 0 /opt/web/wiki/common/extensions/CentralNotice/includes/Banner.php(782): Banner->populateBodyContent
 * 2) 1 /opt/web/wiki/common/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(524): Banner->getBodyContent
 * 3) 2 /opt/web/wiki/common/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(380): SpecialCentralNoticeBanners->generateBannerEditForm(string)
 * 4) 3 /opt/web/wiki/common/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(73): SpecialCentralNoticeBanners->showBannerEditor
 * 5) 4 /opt/web/wiki/common/includes/specialpage/SpecialPage.php(384): SpecialCentralNoticeBanners->execute(string)
 * 6) 5 /opt/web/wiki/common/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(string)
 * 7) 6 /opt/web/wiki/common/includes/MediaWiki.php(265): SpecialPageFactory::executePath(Title, RequestContext)
 * 8) 7 /opt/web/wiki/common/includes/MediaWiki.php(562): MediaWiki->performRequest
 * 9) 8 /opt/web/wiki/common/includes/MediaWiki.php(412): MediaWiki->main
 * 10) 9 /opt/web/wiki/en/index.php(46): MediaWiki->run
 * 11) 10 {main}

it work well if i try to access this same page from the language where the template has been created

Asked By wiki.frogg.fr - 03 April 2054 (UTC)

Transitioning from large banner to regular one with only two bucket? (non-WM use)
I want to do what FR campaigns do - show a large banner once and then transition to a smaller one. However, since the bucket mixin's definition is A->C, B->D (or randomized), it seems I will have to set 4 buckets and therefore 4 banners (which I do not have). How can I achieve this with just two banners? Thanks! --FFS Talk 06:17, 27 June 2016 (UTC)

Scroll position messed up after the banner is added
Let's say I'm on Movie. The scroll position is at the section title "Plot". Once a central notice is inserted (so, after some ajax requests, and a jquery "document ready"), the scroll position is offset by the height of the banner.

It could be fixed in ext.centralNotice.display.js, by repositioning the scroll after the banner has been inserted, with this code :

Od1n (talk) 09:20, 27 November 2017 (UTC)

CentralNotice and Semantic Mediawiki
Good afternoon! After installing the CentralNotice extension, I do not see all the service pages associated with the Semantic Mediawiki, and when I try to view the properties of the page, the notification "No such service page" is displayed, what can it be?

Banner is not shown
Hello dear all! I am running following MW 1.35.5 with PHP 7.4.14 (cgi-fcgi). And I see that on the page of the extension there is a requirement to have MW 1.37.

I have created a campaign and banner for it. But it is not shown on pages. How shall can I found out why the banner is not shown?

P.S. Moreover when I click the bannet to preview on wiki, there is no banner appeared. PLease help. Fokebox (talk) 10:12, 16 December 2021 (UTC)

Error Loading Banner Preview
When I add the banner, it will showed the Error Loading Banner message.

I can't do live preview.

I used the templateV2 as the template.

Lotusccong (talk) 07:46, 28 December 2022 (UTC)