r88550 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88549‎ | r88550 | r88551 >
Date:22:32, 21 May 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 29033) Filter is lost when I'm submitting the search form
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -64,13 +64,12 @@
6565 return;
6666 }
6767
68 - $pathForm = $this->showForm();
69 -
7068 // Get the total count across all pages
7169 $dbr = wfGetDB( DB_SLAVE );
7270 $revCount = $this->getRevCount( $dbr );
7371
7472 $pager = $this->getPager();
 73+ $pathForm = $this->showForm( $pager->getHiddenFields( array( 'path' ) ) );
7574
7675 // Build batch change interface as needed
7776 $this->batchForm = $wgUser->isAllowed( 'codereview-set-status' ) ||
@@ -182,15 +181,12 @@
183182 }
184183
185184 /**
 185+ * @param $hidden string
 186+ *
186187 * @return string
187188 */
188 - function showForm() {
 189+ function showForm( $hidden = '' ) {
189190 global $wgScript;
190 - if ( $this->mAuthor ) {
191 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/author/' . $this->mAuthor );
192 - } else {
193 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' );
194 - }
195191
196192 $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
197193 "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" .
@@ -204,11 +200,11 @@
205201 Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . '&#160;<strong>' .
206202 Xml::span( $this->mAppliedFilter, '' ) . '</strong>&#160;' .
207203 Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) .
208 - '</td>' .
209 - Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) );
210 - } else {
211 - $ret .= Html::hidden( 'title', $special->getPrefixedDBKey() ) ;
 204+ '</td>';
212205 }
 206+
 207+ $ret .= $hidden;
 208+
213209 $ret .= "</tr></table></fieldset></form>" ;
214210
215211 return $ret;

Comments

#Comment by 😂 (talk | contribs)   02:41, 8 June 2011

Have I mentioned how much Pager sucks?

Status & tagging log