Last modified: 2011-11-14 20:06:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21833, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19833 - Please make IP address search behavior configurable
Please make IP address search behavior configurable
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Trevor Parscal
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-19 23:06 UTC by Michael Renner
Modified: 2011-11-14 20:06 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Configuration Option (2.04 KB, patch)
2011-09-24 05:16 UTC, Olivier Finlay Beaton
Details

Description Michael Renner 2009-07-19 23:06:10 UTC
Hi,

please make the current behavior of MediaWiki, treating IP address searches as "search contributions" configurable. This implicit search casting might be interesting on large public sites like WikiPedia, but it's troublesome for those with a small or closed user group.

We use MediaWiki internally to document our Servers and Network infrastructure; IP addresses are one of the prevalent things we document. When we search for IP addresses we expect to get all pages containing the IP address, not contributions by an user with such an address.

Having to patch includes/SearchEngine.php by hand is doable for us, but we plan to release our collection of templates and robots as a complete product to the public, and in that context this would be one additional step when deploying or upgrading Mediawiki.

Best regards,
Michael
Comment 1 Brion Vibber 2009-07-27 17:01:34 UTC
Trevor, I'm putting this on your plate as part of the go/search behavior change for redesigned search box.

For background -- if the search term is recognized as an IP address and no article with that name exists, on 'go' search we jump to Special:Contributions on the address:

http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=155.198.79.45
->
http://en.wikipedia.org/wiki/Special:Contributions/155.198.79.45

If the contribs link is available in the dropdown but doesn't force you to go there, that's probably fine for our needs.
Comment 2 Olivier Finlay Beaton 2011-09-24 05:16:35 UTC
Created attachment 9094 [details]
Configuration Option

I made a patch to add configuration option $wgEnableSearchIPContributors for LocalSettings.php

This is my very first core change and I only started writting extensions on Sept 17th, so please review.

I debated if this should be a user option under search, but decided non-admins would really wonder wth it is. Feel free to disagree and ask me to add that too.

I've been frustrated by the lack of this feature for 2+ years, my corporate wiki contains networking ips of hosts and switches (no it's not a cmdb) and I and the other admins are constantly trying to search by ip. I kept searching for an extension or configuration setting but always came up empty.

Finally today after coding a few extensions I looked into it and I see I might be able to use the hook SearchGetNearMatch to make this an extension, but I'm not certain.

That's when I thought this should really be a config setting and would be a good exercise for my first attempt at a patch. 

So here it is! I used -p1 -i to apply it.
Comment 3 Aaron Schulz 2011-09-24 05:26:33 UTC
Why do we have this behavior at all anyway? I always hated that.
Comment 4 Olivier Finlay Beaton 2011-09-24 20:08:21 UTC
Could it be for lazy admins who want to check if an unlogged in vandal also has an account?
Comment 5 Sumana Harihareswara 2011-09-30 16:00:38 UTC
Added the "patch" and "need-review" keywords; Mark hopes to get someone to review the patch soon.
Comment 6 Roan Kattouw 2011-11-14 19:35:42 UTC
(In reply to comment #2)
> Created attachment 9094 [details]
> Configuration Option
> 
Comments on the patch:
* Please choose a clearer name for the $wg var if you can, the current name is not very descriptive
* Don't use two nested if statements, but use if ( $wgFoo && ... && ... )
* Observe whitespace conventions for your if statements
Comment 7 Roan Kattouw 2011-11-14 20:01:09 UTC
Committed slightly modified patch in r103019 after IRC conversation.
Comment 8 Olivier Finlay Beaton 2011-11-14 20:06:58 UTC
Thanks Roan!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links