From 9f66a91456f6e071f68ca001e86b30b4dfd24948 Mon Sep 17 00:00:00 2001 From: Tomas Vondracek Date: Sat, 24 Oct 2026 10:44:09 +0200 Subject: [PATCH] refactor(field): remove the Shortlink field The Shortlink (alias) input promised to "create an alias or shortlink to this record", but nothing has ever read the value. No route, redirect or template uses it. The field came from the original Bolt 3 extension (bobdenotter/seo), where it was never implemented either (bobdenotter/seo#20), and it was copied along with the rest of the field in 2020. This removes the input, its default key, the matching entry in seo.js, and its three translation units from all 15 locales. Values already stored in a record's SEO JSON are kept and ignored, like before. seo.js adds a listener to every input it looks up without a null check, so the template and the script must agree on the input ids. A new test renders the field and checks that every `#seofields-*` id the script uses is there. --- assets/seo/seo.js | 1 - templates/seo.html.twig | 27 ---------- tests/Twig/SeoFieldScriptTest.php | 85 +++++++++++++++++++++++++++++++ translations/messages.cs.xlf | 18 ------- translations/messages.de.xlf | 18 ------- translations/messages.en.xlf | 18 ------- translations/messages.es.xlf | 18 ------- translations/messages.fr.xlf | 18 ------- translations/messages.hu.xlf | 18 ------- translations/messages.it.xlf | 18 ------- translations/messages.nl.xlf | 18 ------- translations/messages.pl.xlf | 18 ------- translations/messages.pt.xlf | 18 ------- translations/messages.ro.xlf | 18 ------- translations/messages.ru.xlf | 18 ------- translations/messages.sk.xlf | 18 ------- translations/messages.tr.xlf | 18 ------- translations/messages.uk.xlf | 18 ------- 18 files changed, 85 insertions(+), 298 deletions(-) create mode 100644 tests/Twig/SeoFieldScriptTest.php diff --git a/assets/seo/seo.js b/assets/seo/seo.js index bb7919f..0bd3f18 100644 --- a/assets/seo/seo.js +++ b/assets/seo/seo.js @@ -27,7 +27,6 @@ class SeoSnippet { title: document.querySelector('#seofields-title'), description: document.querySelector('#seofields-description'), keywords: document.querySelector('#seofields-keywords'), - shortlink: document.querySelector('#seofields-shortlink'), canonical: document.querySelector('#seofields-canonical'), robots: document.querySelector('#seofields-robots'), og: document.querySelector('#seofields-og'), diff --git a/templates/seo.html.twig b/templates/seo.html.twig index 6d878bf..f303f8a 100644 --- a/templates/seo.html.twig +++ b/templates/seo.html.twig @@ -8,7 +8,6 @@ title: '', description: '', keywords: '', - shortlink: '', canonical: '', robots: '', og: '' @@ -26,7 +25,6 @@ {{ block('seo_description') }} {{ block('seo_keywords') }} {{ block('seo_snippet') }} - {{ block('seo_shortlink') }} {{ block('seo_canonical') }} {{ block('seo_robots') }} {{ block('seo_og') }} @@ -147,31 +145,6 @@ {% endblock %} -{% block seo_shortlink %} - -{% endblock %} - {% block seo_canonical %}