r97203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97202‎ | r97203 | r97204 >
Date:20:57, 15 September 2011
Author:hashar
Status:reverted (Comments)
Tags:
Comment:
New hook RecentChangesListRecentChangesLine which let you customize an
entire recent changes line for user with 'Enhanced recent changes' option
It is equivalent to the existing hook OldChangesListRecentChangesLine

Reported by finlay on IRC.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1303,10 +1303,19 @@
13041304 in the message (bool)
13051305
13061306 'OldChangesListRecentChangesLine': Customize entire Recent Changes line.
 1307+you will also need to use the EnhancedChangesListRecentChangesLine to alter
 1308+the output for user of enhanced recent changes.
13071309 &$changeslist: The OldChangesList instance.
13081310 &$s: HTML of the form "<li>...</li>" containing one RC entry.
13091311 &$rc: The RecentChange object.
13101312
 1313+'RecentChangesListRecentChangesLine': Customize entire Recent Changes line.
 1314+you will also need to use the OldChangesListRecentChangesLine to alter
 1315+the output for user of regular recent changes.
 1316+&$changeslist: The EnhancedChangesList instance.
 1317+&$s: HTML of the form "<li>...</li>" containing one RC entry.
 1318+&$rc: The RecentChange object.
 1319+
13111320 'OpenSearchUrls': Called when constructing the OpenSearch description XML.
13121321 Hooks can alter or append to the array of URLs for search & suggestion formats.
13131322 &$urls: array of associative arrays with Url element attributes
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -61,6 +61,9 @@
6262 to stop it from replace an already existing default sort, and suppress error.
6363 * (bug 18578) Rewrote revision delete related messages to allow better
6464 localisation
 65+* New hook RecentChangesListRecentChangesLine which let you customize an
 66+ entire recent changes line for user with 'Enhanced recent changes' option
 67+ It is equivalent to the existing hook OldChangesListRecentChangesLine
6568
6669 === Bug fixes in 1.19 ===
6770 * $wgUploadNavigationUrl should be used for file redlinks if
Index: trunk/phase3/includes/ChangesList.php
@@ -741,6 +741,8 @@
742742 array_push( $this->rc_cache[$secureName], $rc );
743743 }
744744
 745+ wfRunHooks( 'EnhancedChangesListRecentChangesLine', array(&$this, &$s, $rc) );
 746+
745747 wfProfileOut( __METHOD__ );
746748
747749 return $ret;

Follow-up revisions

RevisionCommit summaryAuthorDate
r97238revert r97203...hashar06:13, 16 September 2011

Comments

#Comment by Quadir (talk | contribs)   02:38, 16 September 2011

Hi, Finlay (irc) quadir (mediawiki) here...

Unfortunately this won't work. First of all $s does not exist in this function (EnhancedChangesList::recentChangesLine), they called it $ret instead.

But even then $ret is very inconsistent in ECL, it will return a lot of blanks, the first date (2011-09-13), then if there is multiple days the previous days change rows will all be smushed infront of it, and then finally the rest of the change rows are outputted by endRecentChangesList(). At that point it will work, but not be very useful in my opinion and require an additional hook in

I discuss alternatives on the bug report I just filled,

https://bugzilla.wikimedia.org/show_bug.cgi?id=30925

#Comment by Nikerabbit (talk | contribs)   05:02, 16 September 2011

Isn't subclassing enough? This hook looks something that is very hard to support if we ever refactor anything on changeslist.

#Comment by Krinkle (talk | contribs)   21:35, 18 September 2011

What is it. RecentChangesListRecentChangesLine or EnhancedChangesListRecentChangesLine ?

Status & tagging log