I have a form created with Toolset Forms various fields. One of them is a multiple single line custom field. When testing the form leaving this field empty, I get the error message upon submission:
Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in .../plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php:101
I temporarily resolved the issue by replacing L. 98 of that file:
if ( is_null( $_values ) ) {
By:
if ( is_null( $_values ) or empty($_values) ) {
The reason I did this is that when the field is not filled by the user, $_values is empty, but it's not null and it's not fulfilling the condition empty($config['repetitive']) either (see L. 95). So it stays '' and is not changed into an array. Due to that, L. 101 fails.
This is a new issue that was not there before I updated from my old version of CRED to version 2.6.22.
Is that a bug or am I missing something?
Thanks!
Hi,
Welcome to Toolset support. Would you please create the same scenario in a clean installation below?
hidden link
If it is possible to replicate the empty single-line problem there, I will immediately report this to the second-tier support to follow up with the development team.
Thanks.
Hi,
Thanks, I was able to recreate the issue on the sandbox. To see the issue, go to hidden link, select "Receive updates", and click "Send". There is a critical error. The critical error does not happen when the radio is set to another position. The issue seems to arise only when there is a conditional cred_show_group inside another one.
Thanks for your help!
Hi,
Thank you for the details. I checked and it seems that you used the value name of the radio box and that is the issue.
Please use 1, 2, 3 instead of the values themselves as it is set in the custom field.
I used 1 for cred_show_group and it seems to be working ok on registration type radio box.
Thanks.