diff --git a/assets/controllers/delete_record_controller.js b/assets/controllers/delete_record_controller.js index 6a5f8e6..0689125 100644 --- a/assets/controllers/delete_record_controller.js +++ b/assets/controllers/delete_record_controller.js @@ -15,7 +15,13 @@ export default class extends Controller { event.preventDefault(); const id = event.currentTarget.getAttribute('data-url').match(/\d+$/)[0]; const modal = this.modalTarget; - const name = this.nameTargets.find(a => a.href.includes(id)).textContent; + let name = ''; + // For record list in landing pages + if (this.nameTargets.length > 1) { + name = this.nameTargets.find(a => a.href.includes(id)).textContent; + } else { + name = this.nameTarget.textContent; + } const message = `The record '${name.trim()}' will be permanently deleted. Proceed?`; diff --git a/templates/bibliography/index.html.twig b/templates/bibliography/index.html.twig index 4f8cda6..f744d18 100644 --- a/templates/bibliography/index.html.twig +++ b/templates/bibliography/index.html.twig @@ -72,7 +72,7 @@ Record ID{{ record.id }} Status{{ record.getStatus() }} Editor(s){{ record.editor }} - Citation{{ record.citation }} + Citation{{ record.citation }} Reference{{ record.reference }} Editorial notes{{ record.notes }} @@ -92,7 +92,7 @@