Page MenuHomePhabricator

add a name and an id to the namespace selector form in the watchlist page
Closed, ResolvedPublic

Description

this patch adds a name and an id attributes to the form element that allows selecting a namespace in the watchlist page

Background (skip if you're impatient):
I tried moving a script that works on the watchlist page from en.wikipedia to meta, but it breaks there; this is because it uses the namespace selector form, which, having no id or name, has to be selected using its index. This works fine on most wikis, but it's very fragile, and indeed in meta there's an extra form before that one (a button to mark all pages as visited), which makes its index be 1 instead of 0.

I am adding a patch that adds a name and an id to the namespace selector form, but please bear in mind that:

  1. It's my first mediawiki patch
  2. I couldn't find the file browsing svn; I used the version on the docs, at http://svn.wikimedia.org/doc/SpecialWatchlist_8php-source.html (I assume it is up to date; for reference, the revision number is r62890 as I write this)
  3. I used WinMerge to generate the patch, and I'm not sure about the configurations. It should be ok, but please double-check
  4. I don't know about mediawiki php naming conventions; I tried to guide myself by the other entries in the SpecialWatchlist.php file
  5. I also made another change that may or may not break something: I removed a name="dummy" from the "enotif_reset" submit button. I'm not sure why it was there, and I'm not sure the function Xml::submitButton() can be called without its second argument, but I thought it could be something someone forgot to remove.

Sorry for the lengthy bug.


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz23240

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:08 PM
bzimport set Reference to bz23240.
bzimport added a subscriber: Unknown Object (MLST).

Modified version of patch applied by hand in r65278. Changed ID to mw-watchlist-form-namespaceselector to clarify it doesn't refer to the namespace selector itself.

The patch you attached was not in unified diff format and was against an old revision, which is why it was pretty much useless for me.

(In reply to comment #1)

Modified version of patch applied by hand in r65278.

Great, thanks!

The patch you attached was not in unified diff format and was against an old
revision, which is why it was pretty much useless for me.

Exactly, that's what I said in my bug report (maybe tl;dr?). I would say that this shows a need to have clearer or easier-to-find instructions on 1) how to browse the svn to find a given piece of the code, and 2) how to submit a patch in bugzilla (a simple warning to use unified format in the attachment form would already be an enhancement). I think bugs with (useful) patches make the life easier for you devs, so you're only helping yourselves by helping us help you :)