Last modified: 2014-05-18 17:10:16 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 T13777, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11777 - Multiple inputboxes make page invalid due to repetitive similar id
Multiple inputboxes make page invalid due to repetitive similar id
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
InputBox (Other open bugs)
unspecified
All All
: Normal minor with 3 votes (vote)
: ---
Assigned To: Trevor Parscal
http://www.mediawiki.org/wiki/Extensi...
:
Depends on:
Blocks: html
  Show dependency treegraph
 
Reported: 2007-10-27 12:16 UTC by Danny B.
Modified: 2014-05-18 17:10 UTC (History)
9 users (show)

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


Attachments

Description Danny B. 2007-10-27 12:16:26 UTC
When putting more inputboxes on page, it becomes invalid since all of them have same id="createbox". Also styling an scripting is very limited then.

http://www.mediawiki.org/wiki/Extension:Inputbox is nice example.

Suggestion: id attribute is handy, so new parameter id within <inputbox> tag would be the best solution. When id not present, no id attribute will be rendered in XHTML output.
Comment 1 Roan Kattouw 2007-10-28 20:53:27 UTC
What about createbox-0, createbox-1, etc.?
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-11-30 19:03:15 UTC
That negates all purpose of an id, probably.  It should just be made a class.
Comment 3 Siebrand Mazeland 2008-08-13 19:53:23 UTC
+testme
Comment 4 Danny B. 2008-09-16 10:25:45 UTC
-testme - the provided link (the extension description itself) is an example of page invalid because of this issue, so it's easily checkable if it's still actual since that site runs from nearby HEAD.

http://www.mediawiki.org/wiki/Extension:Inputbox

http://validator.w3.org/check?verbose=1&ss=1&uri=http%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FExtension%3AInputbox
Comment 5 Chad H. 2009-12-15 11:28:11 UTC
Fixed in r60072.
Comment 6 Gadget850 2012-09-27 11:57:09 UTC
Now seeing this in 1.20wmf12 with HTML5 enabled.

Example:
http://en.wikipedia.org/wiki/Wikipedia:Help_desk/Header
Comment 7 Quiddity 2014-02-06 23:53:30 UTC
Note: the extension currently uses id="searchbox"

Eg. Any page that uses [[template:talk header]] (which defaults to "search=yes") and [[template:archives]] (with the non-default "search=yes") on the same page, will experience this problem. 

([[Talk:American_football]] currently does. Permalink: https://en.wikipedia.org/w/index.php?title=Talk:American_football&oldid=594144478 )

Or indeed, the extension page itself as comment 4 notes.
Comment 8 Alex Monk 2014-04-06 13:46:49 UTC
Quiddity: Are you saying that the value of id is ignored? Because if so I think that's fixed in Gerrit change #124132
Comment 9 Quiddity 2014-04-06 18:24:15 UTC
(In reply to Alex Monk from comment #8)
> Quiddity: Are you saying that the value of id is ignored? Because if so I
> think that's fixed in Gerrit change #124132

My comment 7 was just meant to provide a few more details and examples, and to note that the id it assigns is sometimes "searchbox", and not always (as the old comment 0 says) "createbox". 

Additionally, the example at [[mw:Extension:Inputbox#Parameters]] for forcing it to use "id=bar" (3rd up from bottom) doesn't seem to be working at all. (?)

Sorry, I'm not familiar with php, and don't understand what your patchset will do!

I'm also not sure what the specific real-world repercussions are, for using an id more than once for multiple forms; I just know it's not valid HTML, and ''might'' cause problems somewhere. (Screenreaders? Just other scripts?).

(For context: I'm mainly interested in this bug, because there was a related problem with Parsoid/Flow: bug 60816 and bug 60785 have details.) HTH.
Comment 10 Gerrit Notification Bot 2014-04-06 19:15:30 UTC
Change 124169 had a related patch set uploaded by Brian Wolff:
Avoid duplicate ids

https://gerrit.wikimedia.org/r/124169
Comment 11 Bawolff (Brian Wolff) 2014-04-06 19:18:03 UTC
d comment 0 says) "createbox". 
> 
> Additionally, the example at [[mw:Extension:Inputbox#Parameters]] for
> forcing it to use "id=bar" (3rd up from bottom) doesn't seem to be working
> at all. (?)
> 
> Sorry, I'm not familiar with php, and don't understand what your patchset
> will do!

I recently fixed (Gerrit change #124132) a bug where some types of inputboxes ignore the id parameter. Its not deployed to mediawiki.org yet. In about a week it should be. The search box was also still reusing ids in some situations, comment 10 fixes that issue.
> 
> I'm also not sure what the specific real-world repercussions are, for using
> an id more than once for multiple forms; I just know it's not valid HTML,
> and ''might'' cause problems somewhere. (Screenreaders? Just other scripts?).

Mostly a correctness issue. The biggest issue is for a search box with namespaces checkboxes, if you click on the label text it should check the box, this bug may prevent that from working sometimes. There is the possibility to confuse some javascript (although probably would cause only minor problems). Anyone validating our html, or using a strict XML parser (I don't even know if our html is generally valid xml, so that may be a non-issue) would run into problems.
Comment 12 Gerrit Notification Bot 2014-05-18 16:54:49 UTC
Change 124169 merged by jenkins-bot:
Avoid duplicate ids

https://gerrit.wikimedia.org/r/124169
Comment 13 Bawolff (Brian Wolff) 2014-05-18 17:10:16 UTC
Should be fixed.

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


Navigation
Links