Project

General

Profile

« Previous | Next » 

Revision 4d9660ef

Added by Andreas Kohlbecker over 4 years ago

fix #8718 humane error message in case the page does not exists: polytomous key, description, media, reference

View differences:

modules/cdm_dataportal/cdm_dataportal.module
1239 1239
  cdm_check_valid_portal_page();
1240 1240

  
1241 1241
  $media = cdm_ws_get(CDM_WS_PORTAL_MEDIA, $mediaUuid);
1242
  if (!$media) {
1243
    drupal_set_title(t('Media does not exist'), PASS_THROUGH);
1244
    return FALSE;
1245
  }
1242 1246
  return theme('cdm_media_page', array(
1243 1247
    'media' => $media,
1244 1248
    'mediarepresentation_uuid' => $mediarepresentation_uuid,
......
1545 1549
  cdm_check_valid_portal_page();
1546 1550

  
1547 1551
  $polytomousKey = cdm_ws_get(CDM_WS_POLYTOMOUSKEY, $polytomousKeyUuid);
1552
  if (!$polytomousKey) {
1553
    drupal_set_title(t('Polytomous key does not exist'), PASS_THROUGH);
1554
    return FALSE;
1555
  }
1548 1556

  
1549 1557
  $sourcePager = cdm_ws_get(CDM_WS_POLYTOMOUSKEY, array($polytomousKeyUuid, 'sources'));
1550 1558
  if (is_array($sourcePager->records)) {
......
1827 1835
    return cdm_node_show_simulate($descriptionpage->content);
1828 1836
  }
1829 1837
  else {
1830
    return '';
1838
    drupal_set_title(t('Description does not exist'), PASS_THROUGH);
1839
    return false;
1831 1840
  }
1832 1841
}
1833 1842

  
......
1845 1854
  $named_area = cdm_ws_get(CDM_WS_PORTAL_TERM, $uuid);
1846 1855
  if (empty($named_area) || $named_area->class !== 'NamedArea') {
1847 1856
    drupal_set_title(t('Named area does not exist'), PASS_THROUGH);
1848
    return FALSE;
1857
    return null;
1849 1858
  }
1850 1859
  $named_area_page = new stdClass();
1851 1860

  
modules/cdm_dataportal/includes/pages.inc
1384 1384
  $pathelement = "reference_page";
1385 1385
  RenderHints::pushToRenderStack($pathelement);
1386 1386
  $reference = cdm_ws_get(CDM_WS_REFERENCE, $uuid);
1387
  if (!$reference) {
1388
    drupal_set_title(t('Reference does not exist'), PASS_THROUGH);
1389
    return null;
1390
  }
1387 1391
  if (isset($reference->titleCache)) {
1388 1392
    drupal_set_title($reference->titleCache, PASS_THROUGH);
1389 1393
  }
modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
165 165
       * Special case: Child nodes with empty statements but taxa as leaf are to
166 166
       * treated as if all those taxa where direct children of the source node.
167 167
       */
168
      $islinkToManyTaxa = !isset($child->children[0]->statement) && isset($child->children[0]->taxon->uuid);
168
      $target_taxon_child = [];
169
      foreach($child->children as $sub_child) {
170
        if(!isset($sub_child->statement) && isset($sub_child->taxon->uuid)){
171
          $target_taxon_child[$sub_child->uuid] = $sub_child;
172
        }
173
      }
174
      $islinkToManyTaxa = count($target_taxon_child) > 0;
169 175
      $islinkToTaxon = isset($child->taxon->uuid);
170 176
      $islinkToSubKey = isset($child->subkey->uuid);
171 177
      $islinkToOtherNode = isset($child->otherNode);

Also available in: Unified diff