Project

General

Profile

« Previous | Next » 

Revision 7a751db4

Added by Andreas Kohlbecker over 7 years ago

fix #6114 ref #4379 avoiding empty citation feature block with only footnote keys

View differences:

modules/cdm_dataportal/includes/descriptions.inc
431 431
  if ($prepend_feature_label) {
432 432
    $feature_label = '<span class="nested-feature-tree-feature-label">' . $element->feature->representation_L10n . ':</span> ';
433 433
  }
434
  $render_array['#value'] = $feature_label . $names_used_in_source_markup . $element_markup . $source_references_markup;
435
  $render_array['#value_suffix'] = $annotations_and_sources['foot_note_keys'];
434
  $content_markup = $names_used_in_source_markup . $element_markup . $source_references_markup;
436 435

  
436
  if(!$content_markup && $feature_block_settings['sources_as_content'] !== 1 || $feature_block_settings['sources_as_content_to_bibliography'] == 1){
437
    // no textual content, so skip this element completely, even if there could be an footnote key
438
    // see #4379
439
    return null;
440
  }
441

  
442
    $render_array['#value'] = $feature_label . $content_markup;
443
    $render_array['#value_suffix'] = $annotations_and_sources['foot_note_keys'];
437 444
  return $render_array;
438 445
}
439 446

  
......
1417 1424
      }
1418 1425
    }
1419 1426

  
1427
    // sanitize: remove empty and NULL items from the render array
1428
    $tmp_out_array = $elements_out_array;
1429
    $elements_out_array = array();
1430
    foreach($tmp_out_array as $item){
1431
      if(is_array($item) && isset($item[0])){
1432
        $elements_out_array[] = $item;
1433
      }
1434
    }
1435

  
1420 1436
    return $elements_out_array;
1421 1437
  }
1422 1438

  

Also available in: Unified diff