Project

General

Profile

Revision 0b4ac33b

ID0b4ac33bb52bd8ba4e3fc77ddec4090e7843d15b
Parent d961cf30
Child 31ab4cf9

Added by Patrick Plitzner about 1 year ago

ref #7686 Fix NPE during specimen title generation

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.page.theme
55 55
 *
56 56
 * @ingroup themeable
57 57
 */
58
function theme_cdm_specimen_page_title($variables) {
58
function theme_cdm_specimen_page_title($variables)
59
{
59 60

  
60 61
    $specimen = $variables['specimen'];
61 62
    RenderHints::pushToRenderStack('specimen_page_title');
......
63 64
    $out = '';
64 65

  
65 66
    $collection = null;
66
    if($specimen->collection->code){
67
      $collection = $specimen->collection->code;
68
    }
69
    elseif($specimen->collection->name){
70
      $collection = $specimen->collection->name;
67
    if ($specimen->collection) {
68
        if ($specimen->collection->code) {
69
            $collection = $specimen->collection->code;
70
        } elseif ($specimen->collection->name) {
71
            $collection = $specimen->collection->name;
72
        }
71 73
    }
72 74
    if($specimen->accessionNumber){
73 75
        $specimenID = $specimen->accessionNumber;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)