evoWeb / recaptcha

TYPO3 Extension to make use of googles nocaptcha
GNU General Public License v2.0
6 stars 18 forks source link

Typo3 11.5.1 LTS Deprecation: #89742 - Form mixins exception #45

Closed pixelplumber closed 3 years ago

pixelplumber commented 3 years ago

Hello, thanks very much for this extension. We've been using it on a 9.5LTS version that I recently upgraded to 11LTS as I saw this was compatible. We're getting an exception now when loading the main form backend module or forms on the frontend:

(1/1) #1489260796 TYPO3\CMS\Form\Mvc\Configuration\Exception\CycleInheritancesException

TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin does not exist within the configuration
in /home/<--snipped username-->/public_html/typo3/sysext/form/Classes/Mvc/Configuration/InheritancesResolverService.php line 258

                $inheritedConfiguration = $inheritedConfiguration[$key];
            }

            if ($inheritedConfiguration === null) {
                throw new CycleInheritancesException(
                    $inheritancePath . ' does not exist within the configuration',
                    1489260796
                );
            }

at TYPO3\CMS\Form\Mvc\Configuration\InheritancesResolverService->resolveInheritancesRecursive(array('TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin'))
in /home/<--snipped username-->/public_html/typo3/sysext/form/Classes/Mvc/Configuration/InheritancesResolverService.php line 193

                    $inheritances = $this->getValueByPath($this->referenceConfiguration, $path . '.' . self::INHERITANCE_OPERATOR);

                    //and replace the __inheritance operator by the respective partial
                    if (is_array($inheritances)) {
                        $inheritedConfigurations = $this->resolveInheritancesRecursive($inheritances);
                        $configuration[$key] = array_replace_recursive($inheritedConfigurations, $configuration[$key]);
                    }

                    //remove the inheritance operator from configuration

at TYPO3\CMS\Form\Mvc\Configuration\InheritancesResolverService->resolve(array('RecaptchaMixin' => array('__inheritances' => array('TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin'), 'formEditor' => array('editors' => array(array('identifier' => 'validators', 'templateName' => 'Inspector-ValidatorsEditor', 'label' => 'formEditor.elements.FormElement.editor.recaptchaValidator.label', 'selectOptions' => array(array('value' => 'Recaptcha', 'label' => 'formEditor.elements.TextMixin.validators.Recaptcha.editor.header.label'))))))), array('TYPO3', 'CMS', 'Form', 'mixins', 'formElementMixins', 'RecaptchaMixin'), false)

Not a programmer (more of an integrator) but did some digging. Looks like its related to this deprecation: Deprecation: #89742 - Form mixins

Description All mixins in the “form” extension have been deprecated and should not be used anymore. This affects all inheritances from TYPO3.CMS.Form.mixins. The mixins have been deprecated with TYPO3v10 and will be removed with TYPO3v11. Impact Form setup inheriting mixins from TYPO3.CMS.Form.mixins. will trigger a deprecation warning in TYPO3v10. With TYPO3v11 these mixins will be removed which will lead to an error. Affected Installations Instances using the “form” extension and inheriting from TYPO3.CMS.Form.mixins. in their form setup. Migration Embed the essential parts from TYPO3.CMS.Form.mixins. or migrate them to custom mixins.

and this section of the Recaptcha.yaml. Sorry I don't know how to fix it, but I'm trying to read up on what mixins are in relation to the form framework. Hope its an easy fix.

Again thanks for the great extension, hope this is enough info.

garbast commented 3 years ago

With change https://github.com/evoWeb/recaptcha/commit/6df4a047ee4ca0d971201446a6ec8d88b9ddb45c this should be fixed.

Could you please verfiy this? Please install with version dev-develop and check if it's working for you.

pixelplumber commented 3 years ago

Hi garbast, the dev-develop version looks good. main module and forms all look to be working. Thanks for the quick fix!