http://www.mediawiki.org/wiki/Special:Code/MediaWiki/71826
Revision: 71826
Author: kaldari
Date: 2010-08-27 23:38:40 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
fixing message typo, switching from select to selectRow, removing unneccessary
transaction
Modified Paths:
--------------
trunk/extensions/CentralNotice/SpecialCentralNotice.php
Modified: trunk/extensions/CentralNotice/SpecialCentralNotice.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialCentralNotice.php 2010-08-27
23:38:37 UTC (rev 71825)
+++ trunk/extensions/CentralNotice/SpecialCentralNotice.php 2010-08-27
23:38:40 UTC (rev 71826)
@@ -1166,14 +1166,15 @@
// Start/end don't line up
if ( $start > $end || $end < $start ) {
- $wgOut->wrapWikiMsg( "<div
class='cn-error'>\n$1\n</div>", 'centralnotice-invalid-date-range3' );
- return;
+ $wgOut->wrapWikiMsg( "<div
class='cn-error'>\n$1\n</div>", 'centralnotice-invalid-date-range' );
+ return;
}
// Invalid campaign name
- $res = $dbr->select( 'cn_notices', 'not_name', array(
'not_name' => $noticeName ) );
- if ( $dbr->numRows( $res ) < 1 ) {
+ $row = $dbr->selectRow( 'cn_notices', 'not_name', array(
'not_name' => $noticeName ) );
+ if ( !$row ) {
$wgOut->wrapWikiMsg( "<div
class='cn-error'>\n$1\n</div>", 'centralnotice-notice-doesnt-exist' );
+ return;
}
// Overlap over a date within the same project and language
@@ -1181,7 +1182,6 @@
$endDate = $dbr->timestamp( $end );
$dbw = wfGetDB( DB_MASTER );
- $dbw->begin();
$res = $dbw->update( 'cn_notices',
array(
'not_start' => $startDate,
@@ -1189,7 +1189,6 @@
),
array( 'not_name' => $noticeName )
);
- $dbw->commit();
}
function updateLock( $noticeName, $isLocked ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs