r98488 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98487‎ | r98488 | r98489 >
Date:23:20, 29 September 2011
Author:dasch
Status:resolved (Comments)
Tags:
Comment:
refactoring nessasery because of changes in r98036
readParameters -> handleParameters
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Math/SRF_Math.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php
@@ -18,8 +18,8 @@
1919 protected $m_title = '';
2020 protected $m_description = '';
2121
22 - protected function readParameters( $params, $outputmode ) {
23 - parent::readParameters( $params, $outputmode );
 22+ protected function handleParameters( $params, $outputmode ) {
 23+ parent::handleParameters( $params, $outputmode );
2424
2525 if ( array_key_exists( 'title', $this->m_params ) ) {
2626 $this->m_title = trim( $this->m_params['title'] );
Index: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
@@ -27,7 +27,7 @@
2828 * @see SMWResultPrinter::getResult()
2929 */
3030 public function getResult( SMWQueryResult $results, array $params, $outputmode ) {
31 - $this->readParameters( $params, $outputmode );
 31+ $this->handleParameters( $params, $outputmode );
3232 global $wgLang;
3333 return $wgLang->formatNum( $this->getResultText( $results, SMW_OUTPUT_HTML ) );
3434 }
Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php
@@ -17,7 +17,7 @@
1818
1919 public function getResult( SMWQueryResult $results, array $params, $outputmode ) {
2020 // skip checks, results with 0 entries are normal
21 - $this->readParameters( $params, $outputmode );
 21+ $this->handleParameters( $params, $outputmode );
2222 return $this->getResultText( $results, SMW_OUTPUT_HTML );
2323 }
2424
Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php
@@ -16,8 +16,8 @@
1717 protected $mUserParam = '';
1818 protected $mRealUserLang = null;
1919
20 - protected function readParameters( $params, $outputmode ) {
21 - parent::readParameters( $params, $outputmode );
 20+ protected function handleParameters( $params, $outputmode ) {
 21+ parent::handleParameters( $params, $outputmode );
2222
2323 if ( array_key_exists( 'template', $params ) ) {
2424 $this->mTemplate = trim( $params['template'] );
@@ -45,7 +45,7 @@
4646 $this->hasTemplates = false;
4747
4848 // skip checks, results with 0 entries are normal
49 - $this->readParameters( $params, $outputmode );
 49+ $this->handleParameters( $params, $outputmode );
5050 return $this->getResultText( $results, SMW_OUTPUT_HTML );
5151 }
5252
Index: trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php
@@ -84,8 +84,8 @@
8585 protected $mOutlineProperties = array();
8686 protected $mInnerFormat = '';
8787
88 - protected function readParameters( $params, $outputmode ) {
89 - parent::readParameters( $params, $outputmode );
 88+ protected function handleParameters( $params, $outputmode ) {
 89+ parent::handleParameters( $params, $outputmode );
9090
9191 if ( array_key_exists( 'outlineproperties', $params ) ) {
9292 $this->mOutlineProperties = array_map( 'trim', explode( ',', $params['outlineproperties'] ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r98517follow up to r98488; fixing compat of ical formatjeroendedauw14:31, 30 September 2011
r98519follow up to r98488; fixing compat of calendar formatjeroendedauw14:38, 30 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98036throw out b/c code as this compat has been lost already anywayjeroendedauw21:39, 24 September 2011

Comments

#Comment by Jeroen De Dauw (talk | contribs)   14:28, 30 September 2011

The name change was made because the behaviour of those functions is although conceptually similar, quite different in the actual implementation. Simply changing the names here won't fix compatibility.

#Comment by DaSch (talk | contribs)   15:11, 30 September 2011

for the GalleryFormat it worked fine

#Comment by Jeroen De Dauw (talk | contribs)   15:33, 30 September 2011

Gallery is not using this function at all no? In any case, the problems with this commit are that although the clear fatal error will go away, many other issue will still be there, some of which will be very subtle. So it's important to not see this as a full fix. Also, the method signature is wrong, it should be

protected function handleParameters( array $params, $outputmode ) {

Status & tagging log