The problem I am having is displaying a pre-existing image (of the logged in user) in the form.
I am following the instructions in this post on how to show the image and give users the ability to change it or delete the image (see this article https://www.chronoengine.com/faqs/60-cfv4/cfv4-working-with-the-database/2666-how-can-i-edit-the-record-for-an-image.html)
I’ve almost gotten it working but am getting the error:
Undefined property.... $form_details
[attachment=0]2015-04-10_chronoforms error.jpg[/attachment]
Note the 2nd echo is returning the "no image found" image from the directory... the issue, according to my expert php developer friend:
"The code that is inserted is trying to access information
from the $form variable. That variable exits and contains
data, but I don't see anything for $form->form_details there.
There is no value for the '$form->form_details->name' that
you are using, because there is no '$form->form_details'
at this point, even though I see multiple examples of it
on their forums. I don't know if that is only present after
a POST or not."
The code being using is:
Can anyone figure out what the issue we're having is and how to fix it in Chronoforms V5?
Help is much appreciated.
"Stuck"
I am following the instructions in this post on how to show the image and give users the ability to change it or delete the image (see this article https://www.chronoengine.com/faqs/60-cfv4/cfv4-working-with-the-database/2666-how-can-i-edit-the-record-for-an-image.html)
I’ve almost gotten it working but am getting the error:
Undefined property.... $form_details
[attachment=0]2015-04-10_chronoforms error.jpg[/attachment]
Note the 2nd echo is returning the "no image found" image from the directory... the issue, according to my expert php developer friend:
"The code that is inserted is trying to access information
from the $form variable. That variable exits and contains
data, but I don't see anything for $form->form_details there.
There is no value for the '$form->form_details->name' that
you are using, because there is no '$form->form_details'
at this point, even though I see multiple examples of it
on their forums. I don't know if that is only present after
a POST or not."
The code being using is:
<?php
if ( isset($form->data['image']) && $form->data['image'] ) {
echo "<img src='".JURI::root()."images/sitestuff/ez_user_profile_images/{$form->form_details->name}/{$form->data['image']}' style='max-width:175px' />";
} else {
echo "<img src='".JURI::root()."images/sitestuff/ez_user_profile_images/{$form->form_details->name}/no_image.jpg' style='max-width:175px' />";
}
?>
Can anyone figure out what the issue we're having is and how to fix it in Chronoforms V5?
Help is much appreciated.
"Stuck"