Page MenuHomePhabricator

COMMONSDELINKER-17 Make delinker log search more user-friendly
Closed, ResolvedPublic

Description

This issue was converted from https://jira.toolserver.org/browse/COMMONSDELINKER-17.
Summary: Make delinker log search more user-friendly
Issue type: Improvement - An improvement or enhancement to an existing feature or task.
Priority: Major
Status: Closed
Assignee: Siebrand Mazeland <s.mazeland@xs4all.nl>


From: Ilmari Karonen <nospam@vyznev.net>

Date: Sat, 08 May 2010 19:50:12

The log search form at http://toolserver.org/~delinker/index.php is really picky about filenames, and rather uninformative when it doesn't find a match. I'd like to suggest at least the following improvements:

  • Treat spaces and underscores in filenames as equivalent.
  • Treat the first letter of the filename as case-insensitive.
  • Optionally, apply other MediaWiki title normalization steps (see Title::secureAndSplit()).
  • If no matches are found and the file name contains a colon, suggest searching without the (presumed) namespace prefix.
  • When showing search results, prefill the input field with the filename searched for.
  • If possible, provide a "next page" link if there are more results than fit on the page.

Version: unspecified
Severity: major

Details

Reference
bz61658

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:54 AM
bzimport set Reference to bz61658.

From: Siebrand Mazeland <s.mazeland@xs4all.nl>

Date: Tue, 12 Oct 2010 09:48:30

If you're willing to provide a patch, I can make the functinality available. I'll attach the file for your convenience.


From: Siebrand Mazeland <s.mazeland@xs4all.nl>

Date: Tue, 12 Oct 2010 09:52:46

Current code for http://toolserver.org/~delinker/index.php


From: Ilmari Karonen <nospam@vyznev.net>

Date: Wed, 13 Oct 2010 17:31:51

OK, here's some quick fixes:

  • Filenames are normalized like in MediaWiki's Title::SecureAndSplit().
  • The first letter of filenames is treated case-insensitively by searching for both cases, just in case (pun not intended).
  • The search form is prefilled according to the URL parameters.
  • If a filename was given and no results found, inform the user. If the filename begins with "File:" or "Image:", suggest searching without the prefix and provide an automatic link to do that.

I also made some smaller tweaks while at it:

  • The Content-type header is no longer set twice.
  • False values of the "replacer" URL parameter are treated like null.
  • The script name index.php is no longer hardcoded in links.
  • Results now show file and page names with spaces instead of underscores.
  • Results no longer prepend a colon to page names in namespace 0.

Improvements I did _not_ yet make in this version:

  • Provide paging links ("next N results") and searching by timestamp.
  • Load namespace names from TS DB instead of hardcoding them.
  • Fix the "max" drop-down menu so that non-standard values are not reset to 50.

I put a temporary copy up at http://toolserver.org/~vyznev/temp/cd-index.php for testing; it seems to work fine there.


From: Siebrand Mazeland <s.mazeland@xs4all.nl>

Date: Wed, 13 Oct 2010 20:11:52

Very nice, Ilmari. I've fixed up the indentation of the generated HTML a bit (v3 attached). I've found that some links give a 404. Could you fix that? Example:


From: Ilmari Karonen <nospam@vyznev.net>

Date: Wed, 13 Oct 2010 22:55:17

I'm pretty sure that bug was already in the original version, but well spotted in any case. Here's a fix. While I was at it, I also made the timestamps use &nbsp; instead of a plain space as the separator – that way a single long file/page name won't cause the entire timestamp column to be folded on two lines. (Arguably that's a browser bug, but the workaround was easy enough.)


From: Siebrand Mazeland <s.mazeland@xs4all.nl>

Date: Thu, 14 Oct 2010 06:43:48

v4 is the new live version. Thank you very much for your help. Feel free to address other CommonsDelinker issues. The current maintainers (including me) barely have time to run it, let alone improve on the current functionality.