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).

CommentFileSizeAuthor
#7 fivestar_ids.patch3.3 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

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!

quicksketch’s picture

Title: Validation errors » Duplicate IDs cause validation errors
quicksketch’s picture

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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

marcoBauli’s picture

sweet :) thx

satish.kadyan’s picture

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 (fixed) » 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

quicksketch’s picture

Status: Active » Fixed
FileSize
3.3 KB

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.

Status: Fixed » Closed (fixed)

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