Page MenuHomePhabricator

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



Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:46 PM
bzimport set Reference to bz20976.

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?

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?

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".)

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.

Created attachment 7325
add searchmenu-new-nocreate

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


I applied this patch in r65902

conrad.irwin wrote:

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

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.

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

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

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.

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

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

(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.

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

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).