Image files seem to be randomly disappearing (from the files table in the db, wysiwyg_imageupload_entity still has the record, but pointing to a nonexistent fid in the files table) after upload via this module. Using wysiwyg 6.x-2.1 and ckeditor. Any ideas?
Comments
Comment #1
obrienmd commentedI'm going to be watching the files table for a status = 0, but haven't seen any. Also, in looking through wysiwyg_imageupload.file.inc, I see this:
I'll dig further, but if this is not run, is file status set to temp? Is there a reason $file->new would not be true?
Comment #2
obrienmd commentedHrm looks like $file->new is set earlier in the function, without any option to not set it, so perhaps that's a dead end?
Comment #3
eugenmayer commentedWell it works for me yet, and iam yet not able to see how the error occurs.
in the _wysiwyg_imageupload_upload_file() method the file is uploaded in and set the $file->new. That object is later stored in the cache and loaded in wysiwyg_imageupload_form_validate() to be finally added to the node object in $form['#node']. Thats actually the object the nodeapi is later called with, so $file->new should be properly set.
Could you debug this, that means set a dsm wysiwyg_imageupload_nodeapi to node->imgupload_images and upload images. Have a look if file->new is set. If yes, after saving, have a look at your {files} table, if the file is really persistent.
Thanks for testing!
Comment #4
obrienmd commentedEverything seems to be setting fine right now (persistent)... Will see if the new post's images die tomorrow.
Comment #5
eugenmayer commentedWell seems like a lokal problem then?
Comment #6
obrienmd commentedPerhaps, will keep an eye on this and report back.
Comment #7
eugenmayer commentedComment #8
obrienmd commentedHrm, OK - Blog post was just added by user with images using this module, and status in files table is "0" for all files. However, when I add a blog post, file status is "1" for all files. Perhaps a permissions issue? I'm just looking at the database now, don't have time to peer through permissions for a few hours.
Comment #9
eugenmayer commentedlooking at the code, i cant yet see where it could be a permission issue - not yet
Comment #10
eugenmayer commenteddef. need some more informations, hope you find time
Comment #11
obrienmd commentedI haven't been able to find a thing on this, it's extremely frustrating!!!
Comment #12
eugenmayer commenteda suggestion, as iam using the file-api of drupal, are there any permissions on who is able to set files persistent?
Comment #13
obrienmd commentedNot that I can see. Another oddity - When I, as an admin, post a blog - the files are set to persistent. That leads me to the permissions theory, but it doesn't really pan out... I'm stumped. Also, when I have the user go in and "re-upload" the pics, they seem to take just fine... Odd.
Comment #14
obrienmd commentedIt _must_ be something the user is doing... I just logged in as said user, posted a blog, and everything just worked great. File marked as permanent in the database (status = 1). What... the... heck...
Comment #15
eugenmayer commentedI would love to help you, but yet iam not able to get a clue here :)
Comment #16
tjodolv commentedHello. I just installed this module for testing it, and I noticed that this happened with the first file I uploaded. Did it as user 1. Strange?
Anyway, a great module! Thanks for the good work!
Comment #17
pfrenssenI can confirm the issue. I checked my database and all files that have been uploaded by admin have status=0.
When I upload new files as admin, they are not inserted in TinyMCE at all. When I upload as another user it works fine.
Comment #18
pfrenssenI found the probable cause of this problem.
It was only happening with users who had the 'access devel information' permission of the devel module. I was outputting debug information to the bottom of every page (more specifically the 'Display memory usage' option) and this interferes with the working of imageupload.
Comment #19
eugenmayer commented@ pfrenssen:you isse is different, please check #831276: Make ajax call be more robust against devel ( mem output ) and theme developer
I finally could reproduce this issue here - it happens if you use preview. It seems like cache transfering is not working here - edge case. I will fix this
Comment #20
eugenmayer commentedVery critical actually
Comment #21
eugenmayer commentedWell what a ugly edge case. This only happens if you preview your node and have NO validation errors. In this case the form_build_id is changed, to the rebuild flag ... holy..
http://github.com/EugenMayer/wysiwyg_imageupload/commit/73c62915e291b207...
fixed in rc5
Comment #22
eugenmayer commentedreleased in rc5
Comment #23
obrienmd commentedThanks much, I had just hacked a fix to this (set a rule to manually alter the database on node save)...