Needs review
Project:
Ubercart Dependent Attributes
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2010 at 18:18 UTC
Updated:
5 Jan 2011 at 21:19 UTC
Each time the adjustments form is submitted, new entries are created in the uc_dependent_attributes table even if identical entries already exist, thus creating duplicate entries.
Changing uc_dependent_attributes.module from:
db_query("UPDATE {uc_dependent_attributes} SET enabled = 0 WHERE nid = %d AND combination = '%s'", $form_state['values']['nid'], $value['combo_array']);
if (!db_affected_rows()) {
db_query("INSERT INTO {uc_dependent_attributes} (nid, combination, enabled) VALUES (%d, '%s', 0)", $form_state['values']['nid'], $value['combo_array']);
}
to :
db_query("DELETE FROM {uc_dependent_attributes} WHERE nid = %d AND combination = '%s'", $form_state['values']['nid'], $value['combo_array']);
db_query("INSERT INTO {uc_dependent_attributes} (nid, combination, enabled) VALUES (%d, '%s', 0)", $form_state['values']['nid'], $value['combo_array']);
Solves the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_dependent_attributes.patch | 1.05 KB | cybis |
Comments
Comment #1
summit commentedHi, is this patch committed already?
greetings, Martijn
Comment #2
cybis commentedNo.