task #8379
Updated by Andreas Kohlbecker over 3 years ago
Please
* #8368
* #8370
I am repeating according comments from the original tickets here:
----
# #8370
Important for the review is to understand why the bug was introduced with cdm-dataportal|e89c1115 this was for sure in the attempt to fix another problem.
----
# #8368
After fixing the problems in this code i noticed that this code is not generating any output at all.
I attempted to base the code on existing functions and wrote the following lines:
~~~php
if(isset($specimen_or_observation->specimenTypeDesignations) && count($specimen_or_observation->specimenTypeDesignations) > 0){
// $specimen_or_observation->specimenTypeDesignations are DTOs
$specimen_type_designation_map = array();
foreach($specimen_or_observation->specimenTypeDesignations as $stdDTO){
if(!isset($specimen_type_designation_map[$stdDTO->typeStatus])){
$specimen_type_designation_map[$stdDTO->typeStatus] = array();
}
$specimen_type_designation_map[$stdDTO->typeStatus][] = $stdDTO;
}
$items['data'] = compose_specimen_type_designations($specimen_type_designation_map);
}
~~~
I removed them again and left the original code as it is. This code was introduced in commit:cdm-dataportal|b3ac03bf
TODO: check if it is feasible to simplify and unify the code by using `compose_specimen_type_designations()`. (low priority)