diff --git a/application/controllers/Items.php b/application/controllers/Items.php index c3a50ae09..c89d713a8 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -408,7 +408,7 @@ class Items extends Secure_Controller if ($definition_value['definition_type'] == DROPDOWN) { $values['values'] = $this->Attribute->get_definition_values($definition_id); - $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id); + $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id)->attribute_id; } if (!empty($definition_ids[$definition_id])) diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index fdc3bad3d..7be6db019 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -33,7 +33,7 @@ foreach($definition_values as $definition_id => $definition_value) } else if ($definition_value['definition_type'] == DROPDOWN) { - $selected_value = empty($selected_value) ? $definition_value['selected_value'] : $selected_value->attribute_id; + $selected_value = $definition_value['selected_value']; echo form_dropdown("attribute_links[$definition_id]", $definition_value['values'], $selected_value, "class='form-control' data-definition-id='$definition_id'"); } else if ($definition_value['definition_type'] == TEXT)