Forums

Repeater - sending cloned items not working

pixelhexe 12 Sep, 2023
Trying to send data with the repeater function and I am lost.
Joomla V4, PHP 8.1, ChronoForms V 7.0.10 (local system) and 7.0.11 (remote system).
The error on local and remote system is the same.

For testing purpose I created a really simple form with repeater loop and just 2 text fields with label "Product" and "Colour".

The repeater unit name is "area_repeater_2". First strange phenomenon: I have to give it a data source, for example "article". The data will only be set in the text inputs and dropdowns (hopefully... .after the sending of text inputs will work).

Frontend works fine, I can add and delete items with the repeater and cloner function.

As soon as I try to send more than 1 item (with fields product and colour), I will get an error "0 array_keys(): Argument #1 ($array) must be of type array, null given".

Afterwards I go back with browser navigation and I can see the debugger (which I added in settings of the form):

Array
(
    [chronoform] => serviceformular
    [gpage] => end_page
    [article] => Array
        (
            [product0] => Product 1
            [colour0] => Colour 1
            [product1] => Product 2
            [colour1] => Colour 2
        )

    [__loops] => Array
        (
            [2] => Array
                (
                    [0] => 1
                    [1] => 1
                )

        )

)


In settings I am using "Admin Email" and in the body I filled {data:article} and {email_content}.

When I send only 1 item I get at least a JSON string with the values of my input fields:

{"product0":"Product 1","colour0":"Colour 1"}

How could I possibly change them to readable formatting as

Product: product value

Colour: colour value

?

The {email_content} sends me a table with 4 rows (although only 1 item being sent which should give me only 2 rows!) and 2 columns. In the first column is "Product", "Colour", "Product", Colour", the second column is empty (where the values should be).

Any help is highly appreciated, thank you very much!
pixelhexe 12 Sep, 2023
... and if the data source of repeater remains empty, the input fields are not shown at all in frontend. I have to fill in something like "article", "product" or whatever I want.
pixelhexe 12 Sep, 2023
I took a deeper dive - it seems to be a problem with code in administrator\components\com_chronoforms7\chronoforms\helpers\parser2.php with PHP > 8.0.

In Joomla config I set error reporting to maximum and when I try to send at least 2 "cloned" items (as described), it turns out that the error "array_keys(): Argument #1 ($array) must be of type array, null given" occurs in line 669 of parser2.php -
 $label = str_replace(array_keys($keysData), array_values($keysData), $label);

- so $keysData is not an array here.

Unfortunately my coding knowledge is not good enough for fixing this, but hopefully the developer is able to fix this as soon as possible?
Also without an official version release a patch would be great to get through this quickly. Thank you!
You need to login to be able to post a reply.