xperseguers / t3ext-ig_ldap_sso_auth

TYPO3 Extension ig_ldap_sso_auth. This extension provides LDAP and SSO support for TYPO3.
https://extensions.typo3.org/extension/ig_ldap_sso_auth
GNU General Public License v3.0
30 stars 74 forks source link

Undeclared arguments passed to ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper: onchange. #226

Closed tylkomat closed 3 weeks ago

tylkomat commented 1 month ago

In latest Typo3 11.5.41 this Error is shown when entering the LDAP/SSO backend module. Undeclared arguments passed to ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper: onchange. Valid arguments are: additionalAttributes, data, aria, name, value, property, class, dir, id, lang, style, title, accesskey, tabindex, onclick, size, disabled, options, optionsAfterContent, optionValueField, optionLabelField, sortByOptionLabel, selectAllByDefault, errorClass, prependOptionLabel, prependOptionValue, multiple, required

tylkomat commented 1 month ago

I still receive the same error. Looks like the SelectViewhelper is still evaluated although the section is not used.

tylkomat commented 1 month ago

I tested the extension under Typo3 12 and there I also get the same error. In the Typo3 documentation I can't find onchange as a property on the SelectViewHelper.

xperseguers commented 1 month ago

Ah, interesting, thanks for the follow-up, I must admit my latest test was with ~TYPO3 v13~ TYPO3 v12, strange [edit].

xperseguers commented 4 weeks ago

Just debugged in TYPO3 v12, onchange is indeed an undeclared argument, but it is "catched" in

However, I just think that we could certainly do that instead (only for TYPO3 v12 and up):

diff --git a/Resources/Private/Partials/ConfigurationRecords.html b/Resources/Private/Partials/ConfigurationRecords.html
index 1a68a34..7069dab 100644
--- a/Resources/Private/Partials/ConfigurationRecords.html
+++ b/Resources/Private/Partials/ConfigurationRecords.html
@@ -52,9 +52,10 @@
             value="{currentConfiguration}"
             optionValueField="uid"
             optionLabelField="name"
-            onchange="this.form.submit();"
             class="form-select form-select-sm form-control"
-            style="display: inline-flex; width: 100%;"/>
+            style="display: inline-flex; width: 100%;"
+            additionalAttributes="{onchange: 'this.form.submit();'}"
+    />
 </f:section>

 </html>
tylkomat commented 4 weeks ago

Yes, that works under Typo3 v11 as well and removes the need to have separate handling between v11 and v12+.