Forums

Chonoforms7 Joomla4. Read Data {data:id} has stopped working.

ColinBuckley1964 30 Nov, 2022
Is anyone having the same issue since updating to Joomla 4?
A data read (shown below) was working fine on Joomla 3.10.

The form does not read any data from the #__fields_values table any more, unless I replace {data:id} with an actual article number. Then the form works fine.
Chronoforms was the only component I could not test on my offline server. Grhhhhh!!!
My workaround at the present is to create a new form (modify the where condition for the data read) for each article that requires a form. Not ideal.

Please somebody help.

Colin
ColinBuckley1964 30 Nov, 2022
I would post an image but that functionality has gone....

The read conditions are:
Source Table = #__fields_values

Module Name = ReadCustomFields

Select = All Matching records

Where condition = item_id={data:id}

If I change the Where condition to item_id=632

Then all the fields needed for article 632 are read correctly.

ta
Colin
Colnem 01 Dec, 2022
Hi

Add a Action/Basic/Message before your read_data to display data values by {data.pr:}...
if data[id] is absent or null, read data doesn't work. You have to add parameter id of the article to call your form.
ColinBuckley1964 01 Dec, 2022
Thanks Colnem

Looks like you are right.
Reading {data.pd) returns this

Array
(
[https://southlancscentre_com/] => ldiB6x5fZy96kKo0
[9b84a3edfde950f13f213276122f03b3] => 2766f10c532154825607d74816193fba
[chronoform] => CBTestForm
[CBTestForm] =>
)

Nothing in the data array. Has this been dropped in J4?
Colnem 01 Dec, 2022
I wrote: {data.pr:}

Nothing is dropped in J4. There is an error in your form.
ColinBuckley1964 01 Dec, 2022
Hi

This evening I have uninstalled all Chronoforms extensions,
re-installed (7.0.9),
re-validated with a new key,
restored all forms
Created a new form from scratch.

Using a read data with the Where condition to "item_id=632"
Data is read back from a custom field to the form

Using the Where condition to "item_id={data:id}"
The data is not returned.

These forms worked perfectly with Joomla 3.10, I can only think something in Joomla 4 is preventing {data:id} for working.

Any more ideas folks?

Ta
Colin
Max_admin 01 Dec, 2022
{data:id} is using an "id" parameter passed to the form, are you passing this parameter or is this the Joomla article id ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ColinBuckley1964 01 Dec, 2022
I want the Joomla article ID of the page that is loading the form.
IE {data:id} returns the Article ID of 632 of my test page.

Ta
Max_admin 01 Dec, 2022
So it may be that Joomla 4 has stopped passing the article id as "id" and changed that, I will need to test this first then come back to you!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Colnem 02 Dec, 2022
Hi

Joomla 4 has stopped passing the article Itemid. I said that to admin many months ago!
Colnem 02 Dec, 2022
...
You can read the Itemid adding a PHP Action:
$itemid=\JFactory::getApplication()->getMenu()->getActive()->id;

Then return a CF7 variable:
$this->set("var_itemid", $itemid);

Then use this var in your Where condition:
id = {var:var_itemid}
Colnem 02 Dec, 2022
Sorry: I can edit my posts!

My fix is tested with a form calling by menu link. Never tested in an article page.
Please, say me the result of your test.
ColinBuckley1964 10 Dec, 2022
Hi Colnem

Only just seen your posts from the 2nd.
Will try it out and report back.
(never received a notification email....)
Ta
ColinBuckley1964 10 Dec, 2022
Colnem

So close..............

This code returns the ID of the menu item
$itemid=\JFactory::getApplication()->getMenu()->getActive()->id;

I need the ID of the actual article, as I embed the {chronoforms7}FormID{/chronoforms7} in the article.


#GooglingJFACTORY
Ta
C
ColinBuckley1964 11 Dec, 2022
@Colnem

Thanks you its all working now! Had to tweak your code to return the article ID.
So in the form actions there are 3 items.
Variable - Just the name of the variable var_itemid
PHP - Two lines of code
$itemid=JFactory::getApplication()->input->getInt('id');
$this->set("var_itemid", $itemid);
Read Data
Whare clause using var_itemid

Cheers!
You need to login to be able to post a reply.