Fix dropdown preselection on edit (#68)

This commit is contained in:
jekkos
2018-09-28 20:35:38 +02:00
committed by jekkos
parent 43e3400468
commit 7683cfe5c9
2 changed files with 2 additions and 2 deletions

View File

@@ -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]))

View File

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