r41958 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41957‎ | r41958 | r41959 >
Date:04:31, 11 October 2008
Author:tstarling
Status:old (Comments)
Tags:
Comment:
Revert merge of DismissableSiteNotice into the core (r41679 and subsequent edits). We should have higher standards than this for core code. This is largely my own crap code and there's a reason I didn't commit it to the core in the first place.
* The sitenotice_id hack is virtually unusable and needs to be replaced with a dedicated message update interface.
* There's a need for automatic message expiry.
* The Wikimedia-specific "spite the anons" feature, preventing anonymous users from dismissing site notices because they allegedly don't contribute to the wiki enough to deserve it, needs to be made optional.
Modified paths:
  • /trunk/extensions/DismissableSiteNotice/OBSOLETE (deleted) (history)
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDismissnotice.php (deleted) (history)
  • /trunk/phase3/languages/messages/MessagesAf.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesAm.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesAn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesAr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesArz.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesAs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesAst.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBcc.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBe_tarask.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBg.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesBr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCdo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCrh_cyrl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCrh_latn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesCy.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe_formal.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFi.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFiu_vro.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFrp.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFur.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFy.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesGa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesGl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesGrc.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHi.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHsb.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHu.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHy.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesIa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesId.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesIs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesIt.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesJa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesJut.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesJv.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKaa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_arab.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_cyrl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_latn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKm.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKsh.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesLa.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesLb.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesLi.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesLt.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesMk.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesMl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesMr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesMs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesNan.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesNds.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesNe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesNl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesNo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesOc.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPms.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPt.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQu.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesRo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesRu.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSah.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSdc.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSi.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSk.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSq.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSr_ec.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesStq.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSu.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSv.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTet.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTg_cyrl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTh.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesTs.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesUk.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesUr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesVec.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesVi.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesVo.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesYue.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesZh_classical.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesZh_hans.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesZh_hant.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41679Merging DismissableSiteNotice extension into core.ashley23:46, 4 October 2008

Comments

#Comment by Skizzerz (talk | contribs)   22:16, 11 October 2008

Instead of reverting something that already worked quite well, why not just change it for the better (or ask someone else to)? This kind of attitude means that nothing will ever get done with "bad" code. Besides, the code you reverted was still much better than the extension code (does not have a dependency on javascript in order to even display the sitenotice, among other things). Surely even though it doesn't meet the "standards" of core, it is still loads better than the extension and should have just stayed there until the code could be made "up to standards."

Onwards to the three points that you mentioned, and an easy way to fix each:

  • Instead of a sitenotice_id, why not use the date of the last revision of the MediaWiki:Sitenotice / MediaWiki:Anonnotice page? Either one requires querying the database, so it should not be any performance loss, plus it would make the re-displaying of the notice automatic -- just edit the page and it reappears. If null edits should make it reappear, then use the last touched date instead of the last revision date.
  • "Automatic message expiry"... do you mean the cookie or the message itself. If it is a latter, that is no issue with this merged extension but rather an issue with how the Sitenotice is used, which would mean a major overhaul of the sitenotice code in general. If it was referring to the cookie, that already happens. All one needs to do is change the cookie settings and the expiry time can be shortened or lengthened. If you want to maintain a separate time, a different wg could be used instead of wgCookieExpiration.
  • "spite the anons"... easily accomplished by adding another permission to the wgGroupPermissions array, which also allows it to be restricted more on wikis that don't want logged in users to be able to hide the notice either (and it makes the special page code shorter as well). We could even make that permission true by default, although that means that wikimedia will need to modify that to false.
#Comment by Brion VIBBER (talk | contribs)   01:16, 24 October 2008

Skizzerz, make improvements to the extension. If we some day wish to merge it to core, that can be done in the future. However, DismissableSiteNotice will probably end up largely replaced entirely...

Status & tagging log