r55592 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55591‎ | r55592 | r55593 >
Date:14:34, 26 August 2009
Author:simetrical
Status:resolved (Comments)
Tags:
Comment:
For search, move "create page" below "no results"

This looks slightly less odd, with the user no longer being told to
create the page before they're even told it doesn't exist. But it still
looks pretty odd.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -258,18 +258,6 @@
259259
260260 $wgOut->addHtml( Xml::closeElement( 'form' ) );
261261 $wgOut->addHtml( "<div class='searchresults'>" );
262 -
263 - // show direct page/create link
264 - if( !is_null($t) ) {
265 - if( !$t->exists() ) {
266 - $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $t->getPrefixedText() ) );
267 - } else {
268 - $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $t->getPrefixedText() ) );
269 - }
270 - } else {
271 - // preserve the paragraph for margins etc...
272 - $wgOut->addHTML('<p></p>');
273 - }
274262
275263 // prev/next links
276264 if( $num || $this->offset ) {
@@ -314,6 +302,18 @@
315303 if( $num === 0 ) {
316304 $wgOut->addWikiMsg( 'search-nonefound', wfEscapeWikiText( $term ) );
317305 }
 306+
 307+ // show direct page/create link
 308+ if( !is_null($t) ) {
 309+ if( !$t->exists() ) {
 310+ $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $t->getPrefixedText() ) );
 311+ } else {
 312+ $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $t->getPrefixedText() ) );
 313+ }
 314+ } else {
 315+ // preserve the paragraph for margins etc...
 316+ $wgOut->addHTML('<p></p>');
 317+ }
318318 $wgOut->addHtml( "</div>" );
319319 if( $num === 0 ) {
320320 $wgOut->addHTML( $this->searchFocus() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r56540Fix for r55592: show the direct-page link/create link on search *above* actua...brion17:23, 17 September 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   14:51, 26 August 2009

As long as the 'no results' message stays short like it's supposed to this should be fine. :)

#Comment by Rainman (talk | contribs)   12:08, 17 September 2009

See w:Wikipedia:Village_pump_(technical)#Creating_pages_became_harder for discussion. As article creation is one of important functions of the search page, I don't think it should be moved to bottom of the page.

#Comment by Simetrical (talk | contribs)   15:21, 17 September 2009

This is a bug; I only meant to change it when there were no results. I might have time to fix this tomorrow if no one else gets around to it by then.

#Comment by Apoc2400 (talk | contribs)   12:20, 17 September 2009

See for example http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=test+test&go=Go The text "You may create the page "Test test", but consider checking the search results below to see whether it is already covered." appears below all the search results when it should be above. Also on http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=Berlin&fulltext=Search "There is a page named "Berlin" on this wiki" now appears below the results.

#Comment by Brion VIBBER (talk | contribs)   17:23, 17 September 2009

Fixed in r56540.

#Comment by Simetrical (talk | contribs)   18:51, 17 September 2009

Thanks.

Status & tagging log