An error has occurred. 0 str_contains(): Argument #1 ($haystack) must be of type string, array given

How to fix str_contains error in ChronoForms 8 Preview Mode.

Overview

The problem is that the form data may be clipped by the server's max_input_vars limit, causing the str_contains function to receive an array instead of a string.
Go to ChronoForms 8 global settings and enable the "Increase Max Fields" setting. If the issue persists, re-save the form to reload its data.

Answered
Da DavidLi 25d ago

On some forms in Preview Mode - only "An error has occurred.0str_contains(): Argument #1 ($haystack) must be of type string, array given" loads.

thoughts?

Not sure why some forms load and others don't.  Possibly the broken ones have a Submit function?  ie: Contact forms.

Latest chronoForms8 on latest Joomla 6.

EDIT:  I resaved the forms and now they load...hmmmm...

Re-saving the form worked here as well. Thanks!

Max_admin Max_admin 23d ago
Answer

Hi typomaniac

Maybe your forms data are clipped by the max_input_vars limit on your web server, go to the ChronoForms 8 global settings and enable the Increase Max Fields setting

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 23d ago

What is the problem with the first form exactly ? the form opens fine and is in v8

While the 2nd form is in v7

Please note that you may need to remove the "end_page" from the v8 form after you have imported it because v8 can process actions in the Submit event directly, while v7 could only do that with a different page, which is why you need the "end_page"

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Da DavidLi 23d ago

Looking deeper at my forms.  Found a bunch of "garbage" in 

Behaviors / Error Messages like:

<br /><b>Warning</b>:  Array to string conversion in <b>/var/www/html/libraries/chrono_lib/widgets/fields/text.php</b> on line <b>15</b><br />Array

Not sure if that is related or not.  I cleaned that up on all fields I found "stuff" like that.

unfortunately there has been too much time / integration work for me to tell you exactly how that might have happened...but I suspect it was during an upgrade from earlier ChronoForms.

Max_admin Max_admin 21d ago

Yes, that could have been produced during an update from a previous version, can you remember from which version did you upgrade your forms earlier ? v6 or v7 ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Da DavidLi 21d ago
1 Likes

Hi Max,

I believe it was V7, but like mentioned before, so much has gone on with this site upgrade, I can't remember.

I think the V8 forms are working now.

Not an expert with ChronoForms at all.  Limited testing so far.  But we'll call it a win so far!

Thanx!

Post a Reply