Browse Source

Fix PHP notices.

8.x-1.x 8.x-1.0-beta6
Alexander O'Neill 3 years ago
parent
commit
8e0aec1db4
  1. 33
      bibcite_footnotes.module

33
bibcite_footnotes.module

@ -76,7 +76,7 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) {
$notes['#attached']['library'][] = 'bibcite_footnotes/reference_footnote'; $notes['#attached']['library'][] = 'bibcite_footnotes/reference_footnote';
$dont_show_backlink_text = $config['reference_dont_show_backlink_text']; $dont_show_backlink_text = $config['reference_dont_show_backlink_text'];
$sort_references_by = $config['reference_sort_by'];
$citation_tools = new CitationTools(); $citation_tools = new CitationTools();
if (empty($footnotes)) { if (empty($footnotes)) {
return; return;
@ -241,21 +241,22 @@ function bibcite_footnotes_form_node_form_alter(&$form, FormStateInterface &$for
/** /**
* @var FieldConfig $field_config * @var FieldConfig $field_config
*/ */
$field_config = $ief_instance['instance']; if ($field_config = $ief_instance['instance']) {
// Check if this is a bibcite_reference field type. // Check if this is a bibcite_reference field type.
if ($field_config->getSetting('handler') == 'default:bibcite_reference') { if ($field_config->getSetting('handler') == 'default:bibcite_reference') {
$field_name = $field_config->get('field_name'); $field_name = $field_config->get('field_name');
if (!empty($ief_instance['entities'])) { if (!empty($ief_instance['entities'])) {
foreach ($ief_instance['entities'] as $entity_wrapper) { foreach ($ief_instance['entities'] as $entity_wrapper) {
/** /**
* @var \Drupal\core\Entity\EntityInterface $entity * @var \Drupal\core\Entity\EntityInterface $entity
*/ */
$entity = $entity_wrapper['entity']; $entity = $entity_wrapper['entity'];
if ($entity->getEntityTypeId() == 'bibcite_reference') { if ($entity->getEntityTypeId() == 'bibcite_reference') {
list($citation_text, $citation_key) = bibcite_footnotes_get_ckeditor_select_item($entity); list($citation_text, $citation_key) = bibcite_footnotes_get_ckeditor_select_item($entity);
$bibcite_references[] = [$citation_text, $citation_key]; $bibcite_references[] = [$citation_text, $citation_key];
}
} }
} }
} }

Loading…
Cancel
Save