in2code-de / powermail_cond

Add conditions (via AJAX) to TYPO3 powermail forms for fields and pages
8 stars 23 forks source link

Multiple conditions on one select-field doesn´t work / 403 Error for condition.json #82

Open DTM-TYPO3 opened 1 year ago

DTM-TYPO3 commented 1 year ago

Hi,

I've created a form with several select fields which all depend on the chosen option from Select1. The conditions are all basically the same structure:

Name: Show SelectX Target field: SelectX show OR Rule Name: if option X is selected in Select1 Start field: Select1 contains value "Bläser/Schlagzeug"

I´ve 18 conditions for this Select1. It worked perfectly when there were just 4 conditions, but after adding a 5th one (same structure), the extension doesn´t seem to work anymore. All fields are displayed that should be hidden by the condition. I also get a console error in Chrome saying

POST https://www.DOMAIN.de/PAGE/condition.json 403 (Forbidden) jquery-3.2.1.min.js?1493274518:4

With 4 conditions in it, the condition.json file can be found and read. No error occurs.

This project runs under TYPO3 10.4.37 powermail 8.4.2 powermail_cond 8.2.2

Furthermore there´s an error in the system log saying "PHP Warning: Invalid argument supplied for foreach() in /srv/www/htdocs/public/typo3conf/ext/powermail_cond/Classes/Controller/ConditionController.php line 89"

Maybe that´s a hint?

Thanks in advance and regards Stefanie

DTM-TYPO3 commented 1 year ago

We´ve found out that the error occurred due to the length of the self-defined variable names for the 18 select fields. Since we probably handle too many fields by conditions in total, this brought the extension to its limit. We have now named the fields very simply with "w-1" to "w-18" and the conditions are now all working.

For the future it would be desirable to optimize the extension in this respect.

Thanks and greetings Stefanie