I can't understand what goes into the Ghost field.
If I leave it blank, the previously uploaded image is also deleted from the database. Instead it should save it (stored) in the database.
https://www.chronoengine.com/faqs/60-cfv4/cfv4-working-with-the-database/2666-how-can-i-edit-the-record-for-an-image
How is it possible that you are unable to solve this issue/bug?
Hi Gioacchino,
The Ghost field provides a default value to be returned if the form field is not completed by the user. You could try putting the existing image path in there, but it might be simpler to use custom PHP to check for an empty value and remove it from the dataset before saving - I think that is what the FAQ describes, though for an earlier version of CF.
Bob
Hello GreyHead,
What I indicated should work:
"
I used this value
{var:read_data4.Model1.image}
as source code I see the hidden field correctly filled,
<input type="hidden" name="Model1[image]" value="20220722103020_saveriofrancesco.jpeg" data-ghost="1" />
"
I followed several FAQs about it but I could not solve, not even with a php code that I found in the FAQ and in various posts.
Maybe the php code I found and adapted doesn't work.
I can try again but possibly what would be the value to indicate, do you have a more specific example?
I in the ghost I used this code
{var:read_data4.Model1.image}
Which in the html source correctly displays the path in the hidden field of the ghost. As you can see at the beginning of this thread.
Could you give me a php example on this issue?
Thank you for answering me.
Hi Gioacchino,
Well done, if you can please will you post the solution here to help other users.
Bob