css same id-problem.

Posts: 22
Joined: 08/20/2007

Hi

When more products are on a page. That include this in contemplate:
$node->content['add_to_cart']['#value']

Then the page has many hidden-input items with the same id!!!

And off course, W3C Markup Validator gives errors.

I use Ubercart Alpha 7b

Jurgen.

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

This is actually a problem with Drupal and the Form API. If you have the search block showing up on the search page, you'll see the same thing happen.

Fortunately, it looks like this will be fixed in Drupal 6: http://drupal.org/node/111719.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I think Theoverclocked posted a fix for that before the crash... you might try PMing him and seeing it he stops by.

Matt (not verified)

In uc_product.module on line 1578 ...

BEFORE: $form['qty'] = array('#type' => 'hidden', '#value' => 1);
AFTER : $form['qty'] = array('#id'=>uniqid('qty'),'#type' => 'hidden', '#value' => 1);

This problem is probably elsewhere in the code too (1580), but the general idea is that if you don't give an explicit id attribute, the default value is often a duplicate.