After update: Field is not retrieving title anymore

typomaniac 12 Mar, 2019
Hi chronoengineers,

After today's CF update, this simple title retriever doesn't work anymore:
<?php $article_title = ''; $id = \JRequest::getInt('id', ''); $article = \JTable::getInstance('content'); $article->load($id); $article_title = $article->get('title'); ?><?php echo $article_title; ?>

See:
https://ipda.ch/index.php/offene-seminare-hauptmenu/112-szenisches-denken-und-handeln-im-einzelsetting?chronoform=anmeldung-seminare&event=one
clicking on "Anmeldung" at the bottom of the page.
After update: Field is not retrieving title anymore image 1



N.B. I installed a backuped version on my localhost. With the older CF6 version, everything works fine...


...what happened?

Martin
GreyHead 13 Mar, 2019
Hi Martin,

Where are you putting that PHP - if it is in the element settings I suggest that you move it to a Custom Code element and set a form data value for the Seminar element there.

Bob
typomaniac 13 Mar, 2019
Hi Bob,
thanks. Until now (and since at least one year), the PHP was in the input field:
After update: Field is not retrieving title anymore image 2

This worked perfectly, flawlessly.
But after the last update of CF, nothing is at is was (see also my other post with the still unresolved problem).

Could you explain, where to put what exactly that the former php call works again?
Thanks!

Martin
healyhatman 13 Mar, 2019
PHP block before the display form element (return it instead of echo'ing it). Then use {var:phpblockname}
typomaniac 13 Mar, 2019
I've done that, but nothing changes/works as expected:

After update: Field is not retrieving title anymore image 3
After update: Field is not retrieving title anymore image 4
healyhatman 13 Mar, 2019
"PHP code with OUT tags...."

Take the PHP tags out. Also RETURN the value not ECHO it.

Or put it (with the php tags intact) in a custom code block set to return as var.
typomaniac 13 Mar, 2019
ahem... like that? Doesn't change anything.
The other way (Or put it (with the php tags intact) in a custom code block set to return as var.) is the same...

After update: Field is not retrieving title anymore image 5
Max_admin 13 Mar, 2019
The last one should work but the PHP should be ABOVE the "Display form", is this the case ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
typomaniac 13 Mar, 2019
Yes, it is above. And no, it does not work. Please check below. It is so frustrating: I always update whatever. But when I check my mailbox the next morning and it's full of frustrated customer's messages because things don't work anymore, then that's one thing. The other is that it seems impossible to make things work again as they did before. I spent so many hours now with workarounds and it seems that it's not over yet. Couldn't you please launch a new CF version next time before changing stuff that used to work and based on that we built our forms? I love using CF and it's for many many years now (since 2009) that I pay licences and I'd love to continue working with CF. But not that way. Who pays my work now? Definitely not my customers, because it's not their problem. Sorry 'bout that, but I'm really frustrated.
After update: Field is not retrieving title anymore image 6
After update: Field is not retrieving title anymore image 7
Max_admin 13 Mar, 2019
Your code is working here, so I'm not sure why its not working on your site, do you test the form loaded inside an article with the plugin ? which version did you have before the new update ?

Please try to test the form and add &id=1 (or any valid article id you have) to the url, does it work ?

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
typomaniac 13 Mar, 2019
OK, I brought it to work again: the PHP code had to be in another container of the setup section.
Thanks a lot for your support. Still, there is a deep frustration about the fact, that I obviously have to test and check dozens of CF forms now, after they were updated. I'll think twice or more next time before I update.
Thanks again.
Martin
After update: Field is not retrieving title anymore image 8
Max_admin 14 Mar, 2019
I'm not sure why it stopped working, but using PHP code in the field settings is not supported and should not work.

With the latest update you can save your code in a "Block" of type "functions", then call the block in your forms using the "Stored block" action.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
micalb61 20 Mar, 2019
I also faced the same problem, i did already correct as for your suggestion and it's working, nevertheless I foreseen problem for many users who did use PHP code in the field settings that it was perfectly working before.
Just stating that 'using PHP code in the field settings is not supported and should not work.' it's a bit dangerous for all who did actually used it.
That's my opinion of course.
This topic is locked and no more replies can be posted.