Refinement of 'searchmenu-new' message for users without create permission and searches without results
Closed, ResolvedPublic


Author: matthew.britton

By default, [[MediaWiki:Searchmenu-new]] displays the following message:

Create the page "[[:$1]]" on this wiki!

The English Wikipedia has customized this to:

You may create the page "[[:$1]]", but consider checking the search results below to see whether it is already covered.

This is confusing when the search returns no results. There are two ways this could be remedied;

  • supply a second parameter to the message indicating if there are any results
  • add another message that is used instead of this one when there are no results

Version: unspecified
Severity: enhancement
Whiteboard: gci2013

bzimport set Reference to bz20976.
bzimport created this task.Via LegacyOct 3 2009, 9:41 PM
brion added a comment.Via ConduitOct 4 2009, 8:55 PM

Trevor, Robert, what do you think? Separate messages for no results, pass the result count in, or is there a cleaner way to handle this case?

TrevorParscal added a comment.Via ConduitOct 5 2009, 4:47 PM

I absolutely agree that referring to "results below" should only happen when there are indeed results below. And also, doesn't the use of below violate anyways?

bzimport added a comment.Via ConduitOct 6 2009, 11:32 AM

matthew.britton wrote:

(In reply to comment #2)

And also, doesn't the use of below violate

I think a lot of the en.wikipedia-specific UI was created without much attention to (or even knowledge of) that page; I might go put a link to it somewhere prominent. The 'below' could probably be dropped (though it's not the only place it's used, e.g. the default message for [[MediaWiki:Newarticletext]] has "to create the page, start typing in the box below".)

TheDJ added a comment.Via ConduitApr 21 2010, 11:31 PM

This message MediaWiki:Searchmenu-new is only presented to users who can create articles. However, now there is no good method to present information to users who cannot create articles. For instance. The english Wikipedia used to direct anonymous users to, giving anonymous users a route to follow when they want to create an article, and not leaving them guessing.

I think at the very least an additional message alla [[MediaWiki:searchmenu-new-nocreate]] should be provided.

TheDJ added a comment.Via ConduitApr 23 2010, 11:46 AM

Created attachment 7325
add searchmenu-new-nocreate

Patch for a searchmenu-new-nocreate option. This basically amends r61555 from bug 19600.

Attached: searchmenu-new-nocreate.patch

TheDJ added a comment.Via ConduitMay 4 2010, 3:37 PM

I applied this patch in r65902

bzimport added a comment.Via ConduitMay 4 2010, 3:47 PM

conrad.irwin wrote:

Should this message (or a similarly default blank one) also be used for searches using special search-engine functions: prefix%3AP

TheDJ added a comment.Via ConduitMay 4 2010, 7:30 PM

That isn't very nice indeed conrad....

To fix this would require expanding the includes/search/SearchEngine.php with something that can detect the individual searchterms and interpret their meaning (special or not) and give back solely the searchterms stripped from the special keywords.

TheDJ added a comment.Via ConduitMay 21 2010, 11:36 AM

BTW. Conrad, the issue you refer to is bug 21102.

Peachey88 added a comment.Via ConduitApr 30 2011, 12:09 AM

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

Nemo_bis added a comment.Via ConduitNov 19 2013, 12:36 PM

Adding many blockers of bug 38638 to the list of "easy" bugs, to mark them as candidates for [[mw:Google Code-in]] tasks (gci2013). If you think this bug is not suitable, remove the keyword.

gerritbot added a comment.Via ConduitDec 4 2013, 11:06 PM

Change 99265 had a related patch set uploaded by MegaAlex:
Add search results found as $2 parameter to message searchmenu-new

Aklapper added a comment.Via ConduitDec 5 2013, 12:32 PM

Latest patch is the result of the Google Code-In task so please help reviewing this in a timely manner.

Nemo_bis added a comment.Via ConduitDec 5 2013, 4:47 PM

(In reply to comment #13)

Change 99265 had a related patch set uploaded by MegaAlex:
Add search results found as $2 parameter to message searchmenu-new

This patch is slightly broader in scope than what proposed in the last comments, which ask for to be able to customise searchmenu-new* properly.

I think we can try and apply to searchmenu-new and searchmenu-exists a logic similar to's custom messages'. Currently, if there are no results, search-nonefound above says "There were no results matching the query"; but if there are, nothing is said. So we can cover this case in searchmenu-new and searchmenu-exists with [[translatewiki:Plural#Arbitrary plurals]], simply adding both a sentence of the kind {{PLURAL:$2|0=|See also the page found with your search.|See also the search results found.}}
This would put the parameter into use on the two messages and make it available for the empty one; bug 21102 would then take care of the ugliness of the first half of it.

gerritbot added a comment.Via ConduitDec 8 2013, 6:34 PM

Change 99265 merged by jenkins-bot:
Add search results found as parameter to showCreateLink

SPQRobin added a comment.Via ConduitJan 24 2014, 11:20 PM

Gerrit change 99265 can cause problems for extensions adding extra parameters using the SpecialSearchCreateLink hook.

And I updated the documentation at (please think of the documentation when changing hooks).

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.