|
|
|
@ -214,8 +214,13 @@ function bibcite_footnotes_preprocess_bibcite_footnote_link(&$variables) {
|
|
|
|
|
|
|
|
|
|
function bibcite_footnotes_inline_entity_form_entity_form_alter(&$form, FormStateInterface &$form_state) { |
|
|
|
|
$form['#save_entity'] = TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function bibcite_footnotes_form_node_form_alter($form, FormStateInterface $form_state) { |
|
|
|
|
$ief = $form_state->get('inline_entity_form'); |
|
|
|
|
if ($ief) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$serializer = \Drupal::service('serializer'); |
|
|
|
|
// Inline entity storage uses hashes to separate out the field instances. |
|
|
|
|
$bibcite_references = []; |
|
|
|
@ -241,7 +246,7 @@ function bibcite_footnotes_inline_entity_form_entity_form_alter(&$form, FormStat
|
|
|
|
|
$citation_text = trim(strip_tags(render($build))); |
|
|
|
|
$citation_hash = md5(implode('', $data)); |
|
|
|
|
// Attempt to match up pre-saved entities with the eventual saved ones. |
|
|
|
|
$citation_key = !empty($entity->getOriginalId()) ? $entity->getOriginalId() : $citation_hash; |
|
|
|
|
$citation_key = $entity->getOriginalId(); |
|
|
|
|
$bibcite_references[] = [$citation_text, $citation_key]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|