Duplicate IDs cause validation errors on multiaxis rating on a node in 6.x-1.15 version

marcoBauli - November 21, 2007 - 15:53
Project:Fivestar
Version:6.x-1.15
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

Hei, Fivestar is a really cool little widget, thanks a lot for it :)

Just wanted to tell that the W3C markup validator throws 4 validation errors about duplicated input type IDs on frontpage if the rating is shown in teasers:

  • ID "edit-content-type" already defined.
  • ID "edit-content-id" already defined.
  • ID "edit-auto-submit-path" already defined.
  • ID "edit-submit" already defined.

The W3 validator gives the following advice:

An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).

#1

quicksketch - November 30, 2007 - 05:00
Priority:normal» minor

Unfortunately this isn't the fault of Fivestar. The Forms API automatically assigns those IDs, assuming that the same form will never be shown twice on the same page. Of course this definitely isn't the case with Fivestar. I'll check if disabling these automatic IDs is something we can do easily, but I'm not going to stress about it. Patches to fix the problem will be welcomed. Thanks for pointing it out!

#2

quicksketch - November 30, 2007 - 05:01
Title:Validation errors» Duplicate IDs cause validation errors

#3

quicksketch - December 14, 2007 - 15:45
Status:active» fixed

I manually set the #id property of all fivestar elements to be node-id specific. So the ids will be something like edit-auto-submit-path-10, where 10 is the node id. So this significantly reduces the problem though not complete elimination of it.

#4

Anonymous - December 28, 2007 - 15:52
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#5

marcoBauli - January 11, 2008 - 10:06

sweet :) thx

#6

satish.kadyan - May 28, 2009 - 08:37
Title:Duplicate IDs cause validation errors» Duplicate IDs cause validation errors on multiaxis rating on a node in 6.x-1.15 version
Version:5.x-1.x-dev» 6.x-1.15
Status:closed» active

fivestar rating is really cool features. however
on multi axis rating, edit-content-id-15 duplicate error comes.
i need to make page w3c valid,
please suggest how to do that, is there any patch is going to release or issue can be suppose to fix in next releases.
thanks in advance for suggestion

regards,
Satish

#7

quicksketch - July 1, 2009 - 02:43
Status:active» fixed

Newer versions of Drupal 6 seem to contain ID checking to prevent duplicate IDs on form elements. In Fivestar this means that we can safely remove all the ID checking entirely, and just let core handle everything for us. This should solve the problem with duplicate IDs when doing multi-axis rating.

Note this patch is only applied to the Drupal 6 version, since Drupal 5 does not do any checking for duplicate IDs.

AttachmentSize
fivestar_ids.patch 3.3 KB

#8

System Message - July 15, 2009 - 02:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.