Last modified: 2013-04-22 16:15:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40619, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38619 - GlobalBlocking uses deprecated Block::decodeExpiry (deprecated in 1.18)
GlobalBlocking uses deprecated Block::decodeExpiry (deprecated in 1.18)
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
GlobalBlocking (Other open bugs)
master
All All
: Unprioritized minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 22:24 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-04-22 16:15 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-07-23 22:24:19 UTC
Seen on 'beta' while auto blocking a user (I believe with sorbs).

Use of Block::decodeExpiry was deprecated in MediaWiki 1.18. [Called from GlobalBlocking::getUserBlockErrors in /usr/local/apache/common-local/php-master/extensions/GlobalBlocking/GlobalBlocking.class.php at line 76]
Comment 1 Alex Monk 2012-07-23 22:42:16 UTC
># Messy B/C until $wgLang->formatExpiry() is well embedded
>$blockExpiry = Block::decodeExpiry( $block->gb_expiry );

The comment was added in r84258, but I'm not sure what it means. Maybe this has since been fixed?
Comment 2 Sam Reed (reedy) 2012-07-24 22:17:40 UTC
formatExpiry is relatively new

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blobdiff;f=languages/Language.php;h=504f8826e39744b6368cf1eab1666f910f486dc5;hp=6d971b5d06b1b423f9928a05fee8d04fb65b717f;hb=91e7b5a93c6bcc9ba30101107cf75c488db9b769;hpb=757e8c7bff29da462ecca37752555336011afd26

Fri, 18 Mar 2011 19:15:56

I'm guessing it's some back compat related comment. It was not long after 1.17, but not there till 1.18. That's enough to not really worry about breaking back-compat. Expecting trunk versions of extensions to run with arbitary versions of MediaWiki is just daft

I note it is missing a @since annotation (which I'll add in a few)


	public static function decodeExpiry( $expiry, $timestampType = TS_MW ) {
		wfDeprecated( __METHOD__, '1.18' );
		global $wgContLang;
		return $wgContLang->formatExpiry( $expiry, $timestampType );
	}


Just replace the call in Global Blocking

$blockExpiry = Block::decodeExpiry( $block->gb_expiry );

with

global $wgContLang;
$blockExpiry = $wgContLang->formatExpiry( $block->gb_expiry, TS_MW );

and call it a fixed bug.

Though, $wgContLang seems slightly out of place, when surrounding code in getUserBlockErrors() using $wgLang. But that's an aside
Comment 3 Alex Monk 2012-07-24 22:25:37 UTC
Gerrit change #16574
Comment 4 Alex Monk 2012-09-16 14:59:27 UTC
While my changeset was still awaiting review, Siebrand did this partly in Gerrit change #22432. Both are merged now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links