r107550 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107549‎ | r107550 | r107551 >
Date:01:49, 29 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
fixed id field value when the validation stops save and shows form again. also fixed parsing of date
Modified paths:
  • /trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditTerm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialEditTerm.php
@@ -137,7 +137,7 @@
138138 }
139139
140140 function getInputHTML( $value ) {
141 - $value = explode( 'T', wfTimestamp( TS_ISO_8601, $value ) );
 141+ $value = explode( 'T', wfTimestamp( TS_ISO_8601, strtotime( $value ) ) );
142142 return parent::getInputHTML( $value[0] );
143143 }
144144
Index: trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php
@@ -234,8 +234,15 @@
235235 protected function getFormFields() {
236236 $fields = array();
237237
238 - $fields['id'] = array ( 'type' => 'hidden' );
 238+ $fields['id'] = array( 'type' => 'hidden' );
239239
 240+ // This sort of sucks as well. Meh, HTMLForm is odd.
 241+ if ( $this->getRequest()->wasPosted()
 242+ && $this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) )
 243+ && $this->getRequest()->getCheck( 'wpitem-id' ) ) {
 244+ $fields['id']['default'] = $this->getRequest()->getInt( 'wpitem-id' );
 245+ }
 246+
240247 return $fields;
241248 }
242249

Sign-offs

UserFlagDate
Nikerabbitinspected06:51, 29 December 2011

Status & tagging log