I am very thorough on keeping errors on my xhtml to as close to 0 as possible. To this end i keep a copy of a validation plugin installed within firefox that alerts me to potential errors with my markup.
4.7.3 i had near 0 errors for almost all of my pages (all viewable public pages were error free). Upon upgrading to 4.7.4 i noticed one error. Checking this further reveals the following :-
... anchor "..." already defined
Cause:
An anchor with the same name is already defined. Each anchor should be unique.
Solution:
Choose another name for the anchor or modify the previous one.
References:
Anchors: http://www.w3.org/TR/html4/struct/links.html#h-12.2.1
The anchor in question is
<input type="hidden" name="edit[form_token]" id="edit-form_token" value="457943807165e6dda10d4c31f941ded1" />
It is defined in two places on the markup, by the submit button on comments and further tests reveal a new version of it has been added under the comments control dialogue, whcih we have enabled, that was not present on 4.7.3, thus causing the error. Reverting my test site to 4.7.3 sees the error disappear and only once instance become again available.
I'm keen to get back to 0 errors once more so commit this bug for further investigation
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | form_token_dupids.patch.txt | 793 bytes | heine |
Comments
Comment #1
webchickI think this is the issue...
Because the form token element is always given an ID of "form_token", if there is more than one on the page, it will cause validation errors.
We probably need to name it {$form_id}_token or form_token_1/form_token_2 (increment for each form on the page) to stop this from happening.
This will also be an issue in HEAD.
Comment #2
webchickI'm also wondering if this has other side effects other than validation... for example, the ability to spoof tokens from one form to another? Probably not...
Comment #3
heine commentedPatch generates an id=edit-form-id-form-token.
This will break anything that depens on the old id (eg javascript attach), though I'm not sure it is / has been used much.
Validation of the token is unrelated to its id.
Comment #4
heine commentedComment #5
heine commentedCVS will be done in http://drupal.org/node/90508
Comment #6
desm0n commentedThanks guys. Does this just effect the comments module ?
And i could just download the CVS to fix yes ?
Thanks again.
Comment #7
killes@www.drop.org commentedapplied
Comment #8
heine commentedNot a straight backport, but necessary nontheless.
Comment #9
forngren commentedNon supported version, so no backport.