r69716 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69715‎ | r69716 | r69717 >
Date:07:00, 22 July 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix bug from r61759

Assign $text = null; before using it in a hook call
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -210,6 +210,7 @@
211211 $this->fld_url = isset( $prop['url'] );
212212 $this->fld_readable = isset( $prop['readable'] );
213213 $this->fld_preload = isset( $prop['preload'] );
 214+ $this->fld_displaytitle = isset( $prop['displaytitle'] );
214215 }
215216
216217 $pageSet = $this->getPageSet();
@@ -290,6 +291,7 @@
291292 $pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] );
292293 $pageInfo['counter'] = intval( $this->pageCounter[$pageid] );
293294 $pageInfo['length'] = intval( $this->pageLength[$pageid] );
 295+
294296 if ( $this->pageIsRedir[$pageid] ) {
295297 $pageInfo['redirect'] = '';
296298 }
@@ -347,11 +349,17 @@
348350 if ( $title->exists() ) {
349351 $pageInfo['preload'] = '';
350352 } else {
 353+ $text = null;
351354 wfRunHooks( 'EditFormPreloadText', array( &$text, &$title ) );
352355
353356 $pageInfo['preload'] = $text;
354357 }
355358 }
 359+
 360+ if ( $this->fld_displaytitle ) {
 361+
 362+ }
 363+
356364 return $pageInfo;
357365 }
358366
@@ -602,7 +610,8 @@
603611 ' subjectid - The page ID of the parent page for each talk page',
604612 ' url - Gives a full URL to the page, and also an edit URL',
605613 ' readable - Whether the user can read this page',
606 - ' preload - Gives the text returned by EditFormPreloadText'
 614+ ' preload - Gives the text returned by EditFormPreloadText',
 615+ ' displaytitle - Gives the way the page title is actually displayed',
607616 ),
608617 'token' => 'Request a token to perform a data-modifying action on a page',
609618 'continue' => 'When more results are available, use this to continue',

Follow-up revisions

RevisionCommit summaryAuthorDate
r69719(bug 23936) - Add "displaytitle" to query/info API...reedy08:48, 22 July 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61759* (bug 20809) Expose EditFormPreloadText via the API...reedy22:06, 31 January 2010

Comments

#Comment by Reedy (talk | contribs)   07:07, 22 July 2010

No point reverting the extra accidentally commited stuff. Will be finishing it off soon (it does nothing, so shouldn't cause any problems, bar a false positive on the api help)

#Comment by Bryan (talk | contribs)   08:22, 22 July 2010

Instead of a displaytitle parameter, I would prefer a more general prop=pageprops and let the clients make out themselves whether there is a displaytitle in it or not.

Status & tagging log