Project

General

Profile

Revision 395b1b10

ID395b1b1091533e64089cd6d0ca6b710f24cf23bb
Parent c4dd76b6
Child e9970345

Added by Andreas Kohlbecker 6 months ago

ref #9666 save access to unset name properties

View differences:

modules/cdm_dataportal/cdm_tokens/cdm_tokens.module
107 107

  
108 108
    if(isset_not_empty($taxon_name)){
109 109
      $current_token_values['taxon_name'] = $taxon_name->nameCache;
110
      $current_token_values['taxon_name:family'] = $taxon_name->rank->isFamily ? $taxon_name->genusOrUninomial : null;
111
      $current_token_values['taxon_name:genus_or_uninomial'] = $taxon_name->genusOrUninomial;
112
      $current_token_values['taxon_name:genus'] = !$taxon_name->rank->isSupraGeneric ? $taxon_name->genusOrUninomial : null;
113
      $current_token_values['taxon_name:infrageneric_epithet'] = $taxon_name->rank->isInfraGeneric ? $taxon_name->infraGenericEpithet : null;
114
      $current_token_values['taxon_name:epithet'] = $taxon_name->rank->isSpecies || $taxon_name->rank->isInfraSpecific ? $taxon_name->specificEpithet : null;
115
      $current_token_values['taxon_name:infraspecific_epithet'] = $taxon_name->rank->isInfraSpecific ? $taxon_name->infraSpecificEpithet : null;
110
      $current_token_values['taxon_name:family'] = $taxon_name->rank->isFamily & isset_not_empty($taxon_name->genusOrUninomial)? $taxon_name->genusOrUninomial : null;
111
      $current_token_values['taxon_name:genus_or_uninomial'] = isset_not_empty($taxon_name->genusOrUninomial) ?  $taxon_name->genusOrUninomial : NULL;
112
      $current_token_values['taxon_name:genus'] = !$taxon_name->rank->isSupraGeneric & isset_not_empty($taxon_name->genusOrUninomial) ? $taxon_name->genusOrUninomial : null;
113
      $current_token_values['taxon_name:infrageneric_epithet'] = $taxon_name->rank->isInfraGeneric & isset_not_empty($taxon_name->infraGenericEpithet) ? $taxon_name->infraGenericEpithet : null;
114
      $current_token_values['taxon_name:epithet'] = ( $taxon_name->rank->isSpecies || $taxon_name->rank->isInfraSpecific ) & isset_not_empty($taxon_name->specificEpithet) ? $taxon_name->specificEpithet : null;
115
      $current_token_values['taxon_name:infraspecific_epithet'] = $taxon_name->rank->isInfraSpecific & isset_not_empty($taxon_name->infraSpecificEpithet) ? $taxon_name->infraSpecificEpithet : null;
116 116
      if(@isset_not_empty($taxon_name->rank->representation_L10n)) {
117 117
        $current_token_values['taxon_name:rank'] = $taxon_name->rank->representation_L10n;
118 118
      }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)