- Issue created by @raffaelj
I had another look. This time with an open dev console in my Firefox and many errrors. For some reason the errors are only on the English version, not in the German one.
Uncaught TypeError: drupalSettings.user is undefined http://localhost:8080/core/modules/contextual/js/contextual.js?v=10.2.3:23 http://localhost:8080/core/modules/contextual/js/contextual.js?v=10.2.3:314 contextual.js:23:27 Uncaught TypeError: Drupal.contextual is undefined http://localhost:8080/core/modules/contextual/js/models/StateModel.js?v=10.2.3:17 http://localhost:8080/core/modules/contextual/js/models/StateModel.js?v=10.2.3:130 StateModel.js:17:49 Uncaught TypeError: Drupal.contextual is undefined http://localhost:8080/core/modules/contextual/js/views/AuralView.js?v=10.2.3:11 http://localhost:8080/core/modules/contextual/js/views/AuralView.js?v=10.2.3:59 AuralView.js:11:47 Uncaught TypeError: Drupal.contextual is undefined http://localhost:8080/core/modules/contextual/js/views/KeyboardView.js?v=10.2.3:11 http://localhost:8080/core/modules/contextual/js/views/KeyboardView.js?v=10.2.3:62 KeyboardView.js:11:50 Uncaught TypeError: Drupal.contextual is undefined http://localhost:8080/core/modules/contextual/js/views/RegionView.js?v=10.2.3:11 http://localhost:8080/core/modules/contextual/js/views/RegionView.js?v=10.2.3:75 RegionView.js:11:48 Uncaught TypeError: Drupal.contextual is undefined http://localhost:8080/core/modules/contextual/js/views/VisualView.js?v=10.2.3:11 http://localhost:8080/core/modules/contextual/js/views/VisualView.js?v=10.2.3:109 VisualView.js:11:48 Uncaught TypeError: drupalSettings.path is undefined http://localhost:8080/core/modules/toolbar/js/toolbar.menu.js?v=10.2.3:15 http://localhost:8080/core/modules/toolbar/js/toolbar.menu.js?v=10.2.3:256 toolbar.menu.js:15:31 Uncaught TypeError: pathInfo is undefined http://localhost:8080/core/modules/toolbar/js/escapeAdmin.js?v=10.2.3:16 http://localhost:8080/core/modules/toolbar/js/escapeAdmin.js?v=10.2.3:45 escapeAdmin.js:16:5 Unknown property โenable-backgroundโ. Declaration dropped. advanced:1:19 Unknown property โ-moz-osx-font-smoothingโ. Declaration dropped. advanced:1:3006 Uncaught TypeError: path is undefined attach http://localhost:8080/core/misc/active-link.js?v=10.2.3:25 attachBehaviors http://localhost:8080/core/misc/drupal.js?v=10.2.3:166 attachBehaviors http://localhost:8080/core/misc/drupal.js?v=10.2.3:162 http://localhost:8080/core/misc/drupal.init.js?v=10.2.3:32 listener http://localhost:8080/core/misc/drupal.init.js?v=10.2.3:20 domReady http://localhost:8080/core/misc/drupal.init.js?v=10.2.3:26 http://localhost:8080/core/misc/drupal.init.js?v=10.2.3:31 http://localhost:8080/core/misc/drupal.init.js?v=10.2.3:34 active-link.js:25:42 Uncaught SyntaxError: "" string literal contains an unescaped line break advanced:1:88
Some broken HTML markup caused all the contextual errors.
web/modules/contrib/webform/src/Form/AdminConfig/WebformAdminConfigAdvancedForm.php
Line 103 (unclosed "a" tag):
- 'This behavior is disabled when the <a href=":href">Tippy.js library is disabled</a.' + 'This behavior is disabled when the <a href=":href">Tippy.js library is disabled</a>'
Of course now the German translation is missing, because it was translated from the broken markup, but with correct closing tag. Now also all the fancy options aren't displayed italic anymore. Nice.
Now I'm left with
Uncaught SyntaxError: "" string literal contains an unescaped line break advanced:1:88
in the English and the German version.
web/modules/contrib/webform/src/Form/AdminConfig/WebformAdminConfigAdvancedForm.php
Line 319:
- . PHP_EOL + . '\r\n'
Now both, the English and the German page ask for confirmation (with line break). Pressing the Enter key triggers that confirmation message.
This only fixes the broken HTML. Triggering the confirm alert prevents damage, but is completely out of context. The actual issue should be resolved by moving the repair step into a different form.
This also shows why relying purely on JavaScript isn't the best idea. It can break and than native HTML should do the job.
Side note: This broken code is just another example why enabling all JS libraries by default is a bad idea and enabling CDN usage by default is an even worse idea.
- ๐บ๐ธUnited States jrockowitz Brooklyn, NY
Let's move the repair to a confirmation page.
- Merge request !431Issue #3423904: Pressing Enter key on config/advanced form causes repair instead of save โ (Merged) created by jrockowitz
- last update
8 months ago 536 pass - last update
8 months ago 536 pass - last update
8 months ago 536 pass -
jrockowitz โ
committed 8ef2e018 on 6.2.x
Issue #3423904: Move 'Webform repair configuration' to a dedicated...
-
jrockowitz โ
committed 8ef2e018 on 6.2.x
- Status changed to Fixed
8 months ago 8:08pm 7 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.
I had a quick look using the dev release. Now pressing Enter works as expected and the repair button is much more understandable with the added context. Thanks for the fix.