Buy Now
Sign in

After update: Field is not retrieving title anymore

typomaniac , March 12 2019, 18:46
T
typomaniac 24
March 12 2019, 18:46 #384770
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.
Bildschirmfoto_2019-03-12_um_19.48.56.png

N.B. I installed a backuped version on my localhost. With the older CF6 version, everything works fine...
...what happened?
Martin
GreyHead 64
March 13 2019, 09:33 #384775
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
T
typomaniac 24
March 13 2019, 10:17 #384776
Hi Bob,
thanks. Until now (and since at least one year), the PHP was in the input field:
Bildschirmfoto_2019-03-13_um_11.15.11.png
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
Attachments
Bildschirmfoto_2019-03-13_um_11.15.11.png
Bildschirmfoto_2019-03-13_um_11.15.11.png
(56.56 KiB)
224 Downloads/Views
healyhatman 8
March 13 2019, 10:21 #384777
PHP block before the display form element (return it instead of echo'ing it). Then use {var:phpblockname}
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
T
typomaniac 24
March 13 2019, 10:28 #384778
I've done that, but nothing changes/works as expected:
Bildschirmfoto_2019-03-13_um_11.27.07.png
Bildschirmfoto_2019-03-13_um_11.27.30.png
Attachments
Bildschirmfoto_2019-03-13_um_11.27.07.png
Bildschirmfoto_2019-03-13_um_11.27.07.png
(56.47 KiB)
183 Downloads/Views
Bildschirmfoto_2019-03-13_um_11.27.07.png
Bildschirmfoto_2019-03-13_um_11.27.07.png
(56.47 KiB)
214 Downloads/Views
Bildschirmfoto_2019-03-13_um_11.27.30.png
Bildschirmfoto_2019-03-13_um_11.27.30.png
(56.44 KiB)
212 Downloads/Views
healyhatman 8
March 13 2019, 10:29 #384779
"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.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
T
typomaniac 24
March 13 2019, 10:40 #384780
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...
Bildschirmfoto_2019-03-13_um_11.39.35.png
Attachments
Bildschirmfoto_2019-03-13_um_11.39.35.png
Bildschirmfoto_2019-03-13_um_11.39.35.png
(18.16 KiB)
215 Downloads/Views
admin 28
March 13 2019, 15:35 #384783
The last one should work but the PHP should be ABOVE the "Display form", is this the case ?
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
typomaniac 24
March 13 2019, 16:43 #384786
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.
Bildschirmfoto_2019-03-13_um_17.36.15.png
Bildschirmfoto_2019-03-13_um_17.36.27.png
Attachments
Bildschirmfoto_2019-03-13_um_17.36.15.png
Bildschirmfoto_2019-03-13_um_17.36.15.png
(56.13 KiB)
202 Downloads/Views
Bildschirmfoto_2019-03-13_um_17.36.27.png
Bildschirmfoto_2019-03-13_um_17.36.27.png
(60.82 KiB)
198 Downloads/Views
admin 28
March 13 2019, 18:36 #384791
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
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
typomaniac 24
March 13 2019, 19:10 #384796
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
Bildschirmfoto_2019-03-13_um_20.19.35.png
Attachments
Bildschirmfoto_2019-03-13_um_20.07.44.png
Bildschirmfoto_2019-03-13_um_20.07.44.png
(39.84 KiB)
159 Downloads/Views
Bildschirmfoto_2019-03-13_um_20.07.44.png
Bildschirmfoto_2019-03-13_um_20.07.44.png
(39.84 KiB)
170 Downloads/Views
admin 28
March 14 2019, 18:20 #384843
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
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
M
micalb61 2
March 20 2019, 12:27 #385086
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.