Issue Bug Closed

#106481Form Framework throws error when defining more then one allowedExtensionPaths

Renzo Bauen 04/02/25, 01:17 updated 12/02/25, 14:22

Description

I do häve a problem with allowedExensionPaths:
There are tow extensions defining Forms.
In Extension1 declared in Configuration/Form/MyFormSetup.yaml

persistenceManager:
  allowedExtensionPaths:
    100: EXT:extension1/Resources/Private/Forms/

In Extension2 similar:


persistenceManager:
  allowedExtensionPaths:
    110: EXT:extension2/Resources/Private/Forms/

But then i get the following error in the Backend:

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception

PHP Runtime Deprecation Notice: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /var/www/html/.build/vendor/typo3/cms-form/Classes/Mvc/Persistence/FormPersistenceManager.php line 782

Everithing works fine if i am commenting out one of this two declarations, or if i put

persistenceManager:
  allowedExtensionPaths:
    100: EXT:extension2/Resources/Private/Forms/

In this case, only the Forms of Extension2 are loadet

Some investigation showed that the form sorting function throws the error.

If i set the return value of the callback funciton to 0 (numeric zero) then everithing works fine, exept the sorging of the forms…

This function is defined in cms-form/Classes/Mvc/Persistence/FormPersistenceManager.php line 779ff

Reviews 3

History 49

  1. Renzo Bauen commented <span data-processor="relativetime" data-value="2025-04-02T11:05:11+00:00" > 04/02/25, 11:05 </span>

    vendor/typo3/cms-form/Classes/Mvc/Persistence/FormPersistenceManager.php

    791 -- return false;
    791 ++ return 0;

    I didn’t have the time to test it in different sczenarios, but for me it works with this change.

  2. Markus Klein changed subject Form Framework throws error when defining more then on allowedExtensionPaths Form Framework throws error when defining more then one allowedExtensionPaths <span data-processor="relativetime" data-value="2025-04-10T07:52:45+00:00" > 04/10/25, 07:52 </span>

  3. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-10T08:40:07+00:00" > 04/10/25, 08:40 </span>

    Applied in changeset commit:7e6853ee71cb56d22300f8f0025d92157dd5e75b.