Fix if storage folder is not files
Fix code to save images, correctly handled under any aspect.
Fix as last issue, the cache issue, if the post is in "edit mode".
But it come out a problem to me, little hard to explain, hope someone will understand what i mean.
Let say i added the code that after image as been processed/rotated, delete the attach id row into db, then return the new assigned file ID. So it return an ajax response to setup immediately the new file ID to the just rotated attachment, into the attachments panel that display on post.
What i had to do, for what i see, was to push this new id into the src url of the image.
But when i go to save the post, the response from phpBB when post edited then saved, is an error, that's right, because the request do not contain the new id, but the old one that do not exist anymore, and it need to be changed into this specific hidden element inside the attachments panel:
"td.attach-comment > input"
where there is an input with value of the id of the image, that then i go to update also, together with URL of the image, that point to the new id:
<input type="hidden" name="attachment_data[attach_id]" value="15">
where 15 is the old image id, updated with new one.
When i save the post, now phpBB correctly process the post, images correctly shows in the new position.
But there is a but.
I note that if i process any of the attachments, doing this update to more then an attached image, and i go to save the edited post, the last image processed, even if not inserted into the post, display inside the post, despite it do not contained inside the post body via his callback: let say there is
But the new image id do not refer to Andorra.png, obvious, but let say for example another.png, that even if a callback do not exist into the post, it display inside the post, on top of Andorra.png
Anybody know by what it is caused? which elements require to be updated, before to save the edited post, to avoid this result and why it come out?
Sure i will find the reason and why, but an help would avoid me the recurring headache!