commit 46a93d1e081d9dbf9480176c4dcb13fbd11cfd4a
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Wed Sep 9 12:44:55 2020 +0200

    ref #9222 adapting specimens and typedesignations to single sourced

diff --git a/modules/cdm_dataportal/includes/name.inc b/modules/cdm_dataportal/includes/name.inc
index 5c4e38e7..a402d26d 100644
--- a/modules/cdm_dataportal/includes/name.inc
+++ b/modules/cdm_dataportal/includes/name.inc
@@ -929,7 +929,7 @@ function render_type_designations($type_designations, $enclosing_tag = 'ul', $el
         $link_to_name_page = url(path_to_name($name_type_designation->typeName->uuid));
         $out .= '<'. $element_tag .' class="' . html_class_attribute_ref($name_type_designation) . '">' .  type_designation_status_label_markup($name_type_designation) ;
 
-        if (!empty($name_type_designation->citation)) {
+        if (!empty($name_type_designation->source->citation)) {
           $out .= type_designation_citation_layout($name_type_designation, $separator); // TODO type_designation_citation_layout() needs most probably to be replaced
 
         }
@@ -954,15 +954,15 @@ function render_type_designations($type_designations, $enclosing_tag = 'ul', $el
     foreach ($specimen_type_designations as $specimen_type_designation) {
       $type_citation_markup = '';
 
-      if (!empty($specimen_type_designation->citation)) {
+      if (!empty($specimen_type_designation->source->citation)) {
 
-        $citation_footnote_str = cdm_reference_markup($specimen_type_designation->citation, null, false, true);
-        $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $specimen_type_designation->citation->uuid);
+        $citation_footnote_str = cdm_reference_markup($specimen_type_designation->source->citation, null, false, true);
+        $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $specimen_type_designation->source->citation->uuid);
 
         if (!empty($author_team->titleCache)) {
-          $year = @timePeriodToString($specimen_type_designation->citation->datePublished, true, 'YYYY');
+          $year = @timePeriodToString($specimen_type_designation->source->citation->datePublished, true, 'YYYY');
           $authorteam_str = $author_team->titleCache . ($year ? ' ' : '') . $year;
-          if ($authorteam_str == $specimen_type_designation->citation->titleCache) {
+          if ($authorteam_str == $specimen_type_designation->source->citation->titleCache) {
             $citation_footnote_str = '';
           }
         } else {
@@ -985,8 +985,8 @@ function render_type_designations($type_designations, $enclosing_tag = 'ul', $el
         }
 
         $type_citation_markup .= '&nbsp;(' . t('designated by') . '&nbsp;<span class="typeReference">' . $authorteam_str . '</span>';
-        if (!empty($specimen_type_designation->citationMicroReference)) {
-          $type_citation_markup .= ': ' . trim($specimen_type_designation->citationMicroReference);
+        if (!empty($specimen_type_designation->source->citationMicroReference)) {
+          $type_citation_markup .= ': ' . trim($specimen_type_designation->source->citationMicroReference);
         }
         $type_citation_markup .= $footnote_key_markup . ')';
 
@@ -1909,8 +1909,8 @@ function type_status_order()
  */
 function type_designation_citation_layout($typeDesignation, $footnote_separator = ',') {
   $res = '';
-  $citation = $typeDesignation->citation;
-  $pages = $typeDesignation->citationMicroReference;
+  $citation = $typeDesignation->source->citation;
+  $pages = $typeDesignation->source->citationMicroReference;
   if(isset($typeDesignation->typeStatus->uuid) && isset($typeDesignation->typeStatus->representation_L10n)) {
     if ( $typeDesignation->typeStatus->uuid == UUID_NTD_ORIGINAL_DESIGNATION || $typeDesignation->typeStatus->uuid == UUID_NTD_MONOTYPY) {
       $res = ' (' . $typeDesignation->typeStatus->representation_L10n . ')';
@@ -1930,7 +1930,7 @@ function type_designation_citation_layout($typeDesignation, $footnote_separator
 
     // footnotes should be rendered in the parent element so we
     // are relying on the FootnoteListKey set there
-    $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $typeDesignation->citation->titleCache);
+    $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation->titleCache);
     $res .= render_footnote_key($fkey_typeDesignation, $footnote_separator,TRUE) . ')';
   }
   return $res;
