Commit 4d1b9bd4 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1635503: Duplicated elements when fetching framework

behatnotneeded

Change-Id: I95396afd76fd42efd4f852d74165b3b195dafac7
parent 4ebbbb14
......@@ -50,19 +50,16 @@ function get_framework($table, $select, $se_depth=0) {
$standard_data = get_records_array('framework_standard', 'framework', $fw_data->id, 'priority');
$data['standards'] = $standard_data;
$se_data = array();
foreach ($standard_data as $sk => $se) {
if (record_exists_select('framework_standard_element', "standard='$se->id'")) {
$se_data = get_records_array('framework_standard_element', 'standard', $se->id, 'priority');
}
$se_depth = 0;
foreach($se_data as $se) {
$se->depth = add_depth_to_ses($se, $se_data, $se_depth);
}
$data['standards']['element'][$sk] = $se_data;
if ($se_data = get_records_array('framework_standard_element', 'standard', $se->id, 'priority')) {
$se_depth = 0;
foreach($se_data as $se) {
$se->depth = add_depth_to_ses($se, $se_data, $se_depth);
}
$data['standards']['element'][$sk] = $se_data;
}
}
}
return $data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment