r89668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89667‎ | r89668 | r89669 >
Date:18:13, 7 June 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Fix (Api)BlockTest for Sqlite. getRangeStart()/getRangeEnd() were returning null for user blocks, which was then happily inserted into a NOT NULL column. The IGNORE was just masking the real error. Thanks Brion and MaxSem. Oh, and ping r84475
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Block.php
@@ -703,7 +703,7 @@
704704 public function getRangeStart() {
705705 switch( $this->type ) {
706706 case self::TYPE_USER:
707 - return null;
 707+ return '';
708708 case self::TYPE_IP:
709709 return IP::toHex( $this->target );
710710 case self::TYPE_RANGE:
@@ -720,7 +720,7 @@
721721 public function getRangeEnd() {
722722 switch( $this->type ) {
723723 case self::TYPE_USER:
724 - return null;
 724+ return '';
725725 case self::TYPE_IP:
726726 return IP::toHex( $this->target );
727727 case self::TYPE_RANGE:

Follow-up revisions

RevisionCommit summaryAuthorDate
r92350MFT to REL1_18...hashar10:27, 16 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84475Blame hashar for this giant commit; he teased me for making so many smaller o...happy-melon19:12, 21 March 2011

Comments

#Comment by Hashar (talk | contribs)   18:25, 7 June 2011

awesome! now we have to add a PHPUnit test suite to test the Block class :-)

#Comment by 😂 (talk | contribs)   18:26, 7 June 2011

We do have (some) block tests. That's what led me to tracking this down.

#Comment by Happy-melon (talk | contribs)   18:29, 7 June 2011

Block rewrite isn't in 1.17, it's 1.18.

Status & tagging log