Project

General

Profile

bug #8368

problems in compose_cdm_specimen_or_observation_tree_entry()

Added by Andreas Kohlbecker 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Highest
Category:
cdm-dataportal
Target version:
Start date:
07/16/2019
Due date:
% Done:

100%

Severity:
normal
Found in Version:

Description

Hallo Katja,

ich leite das mal an dich weiter, denn es gibt hier ein Problem mit deinem Kode in compose_cdm_specimen_or_observation_tree_entry():

http://test.e-taxonomy.eu/dataportal/preview/phycobank/cdm_dataportal/taxon/d18f151c-4d64-4c0f-b4db-5ef06d853318

// collect typeStatus as label
if (isset($specimen_or_observation->specimenTypeDesignations)) {
$type_status = array();
foreach ($specimen_or_observation->specimenTypeDesignations as $typeDesignation) {
if (isset($typeDesignation->typeStatus->representation_L10n)) {
$type_status[] = $typeDesignation->typeStatus->representation_L10n;
}
}
if (count($type_status) > 0) {
$type_label = implode(', ', $type_status);
}
}

if (isset($typeDesignation)){ // <-- dies müsste doch innerhalb der foreach-Schleife oben passieren?
$title = $type_label . ' for: ' . $typeDesignation->typifiedNames; // <-- das ist ein array
}else{
$title = $type_label;
}

Du könntest statt dieses code auch einfach die Funktion compose_specimen_type_designations() verwenden

Viele Grüße
Andreas


Related issues

Related to Edit - bug #8369: SpecimenTypeDesignationDTO can not be serialized to JSON Closed 07/16/2019
Copied to Edit - report #8379: Review strange specimen implementations New 07/17/2019

Associated revisions

Revision 0557d51a (diff)
Added by Andreas Kohlbecker 3 months ago

ref #8368 fixing check for exitance of property

History

#1 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from New to In Progress
  • Assignee changed from Katja Luther to Andreas Kohlbecker
  • Priority changed from New to Highest

#4 Updated by Andreas Kohlbecker 3 months ago

working on this issue I found another issue: #8369

#5 Updated by Andreas Kohlbecker 3 months ago

  • Related to bug #8369: SpecimenTypeDesignationDTO can not be serialized to JSON added

#6 Updated by Andreas Kohlbecker 3 months ago

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:

        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 felt the original code as it is. This code was introduced in cdm-dataportal|b3ac03bf

#7 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from In Progress to Feedback
  • Assignee changed from Andreas Kohlbecker to Katja Luther
  • % Done changed from 0 to 10

Katja, please help disentangling the situation.

#8 Updated by Andreas Kohlbecker 3 months ago

  • Copied to report #8379: Review strange specimen implementations added

#9 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from Feedback to Closed
  • Assignee changed from Katja Luther to Andreas Kohlbecker
  • % Done changed from 10 to 100

error message suppressed and visible effect of the problem solved, the further discussion and post release review task is copied to #8379

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)