Forums

CF8 Read Data on load not shown

pimh 05 Oct, 2024

I think I run into a bug when using the Read Data (when using an external database). Resides my joomla database there is another database which contains data independent of the joomla content that I need to use now. 

I want to show one table of this database containing (and in the futur make mutations).

Therefor I included a load data action in the load of page1 and set it up to connect to the external database (which is working since debug shows the expected data). In the on record found section, I included a html content view with php code to write the results. It uses $this->var.... in php and even {var....} via a loop to print the found data. To show the content of the vars array, I even included an echo json_encode on the var array itself.

When viewing the form, my php-code inside the on record is activated an does write output. Nevertheless the data from the read database is not written (as if it is empty), the loop does not run either (as if no records are found). I also see that the var array did not include results of the data read, which is visible in the debug section. After a refresh/reload of the page (for instance by a second click on the menu item to show the page) the code is working as expected. Reopening the browser an again opening the page will again first not show the results, but only after a refresh/reload. 

I tried with and without debugging and with and withou AJAX, no difference. Is this a known problem? Any fix, response or work-around is appreciated. 

Kind regardsPim

Max_admin 05 Oct, 2024

can you post a screenshot of your form setup ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pimh 06 Oct, 2024

Below my setup with some view parts unfolded in which the writing code is visible. 

During creation of this form (refacturing the original to the minimal needed contents), I noticed some vars are remembered from before. The read data was renamed, and I could still run through the results of the former name of the read data (and this was also visible in the debug). So I might have to do with adding the data to a session. It is not added at the beginning of the load, but at the end. So in the next view of the form (refresh/reload) we actually see the results of the former loop and not the ones just read (it is one read behind).

hope this helps,

Pim  

Max_admin 07 Oct, 2024

Hi Pim

Does this problem exist when you test the form in the admin area ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pimh 07 Oct, 2024

It happens on the published form and via the admin console to edit and view forms. No difference in behavior.

Max_admin 02 Nov, 2024
Answer

yes, this is a bug in the read data, I have now fixed this for the next update

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.