From: Sam Reed Date: Wed, 23 Jun 2010 12:34:59 +0000 (+0000) Subject: * (bug 24089) Logevents causes PHP Notice if leprop=title isn't supplied X-Git-Tag: 1.31.0-rc.0~36412 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=19d004fa660bade9abdcc26cebf3f5923080a852;p=lhc%2Fweb%2Fwiklou.git * (bug 24089) Logevents causes PHP Notice if leprop=title isn't supplied Patch by John Du Hart Add a couple of missing braces --- diff --git a/CREDITS b/CREDITS index 10a77d417b..1469bbc6f8 100644 --- a/CREDITS +++ b/CREDITS @@ -88,6 +88,7 @@ following names for their contribution to the product. * Jeremy Baron * Jidanni * Jimmy Xu +* John Du Hart * Karun Dambietz * Kim Hyun-Joon * Lee Worden diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0b584d3c55..6b55caf728 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -240,6 +240,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 24016) API: Handle parameters specified in simple string syntax ( 'paramname' => 'defaultval' ) correctly when outputting help * (bug 19910) Headings of the form ===+\s+ are now displayed as valid headings +* (bug 24089) Logevents causes PHP Notice if leprop=title isn't supplied === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index f98a100be4..1786b01acb 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -85,8 +85,8 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->addFieldsIf( 'page_id', $this->fld_ids ); $this->addFieldsIf( 'log_user', $this->fld_user ); $this->addFieldsIf( 'user_name', $this->fld_user ); - $this->addFieldsIf( 'log_namespace', $this->fld_title ); - $this->addFieldsIf( 'log_title', $this->fld_title ); + $this->addFieldsIf( 'log_namespace', $this->fld_title || $this->fld_parsedcomment ); + $this->addFieldsIf( 'log_title', $this->fld_title || $this->fld_parsedcomment ); $this->addFieldsIf( 'log_comment', $this->fld_comment || $this->fld_parsedcomment ); $this->addFieldsIf( 'log_params', $this->fld_details ); @@ -231,7 +231,9 @@ class ApiQueryLogEvents extends ApiQueryBase { $vals['pageid'] = intval( $row->page_id ); } - $title = Title::makeTitle( $row->log_namespace, $row->log_title ); + if( $this->fld_title || $this->fld_parsedcomment ) { + $title = Title::makeTitle( $row->log_namespace, $row->log_title ); + } if ( $this->fld_title ) { if ( LogEventsList::isDeleted( $row, LogPage::DELETED_ACTION ) ) { @@ -263,8 +265,9 @@ class ApiQueryLogEvents extends ApiQueryBase { $vals['userhidden'] = ''; } else { $vals['user'] = $row->user_name; - if ( !$row->log_user ) + if ( !$row->log_user ) { $vals['anon'] = ''; + } } } if ( $this->fld_timestamp ) {