Strange bug which seems to happen randomly - I uploaded an image to a node, so that when I click "edit post" i see the following code:
[[wysiwyg_imageupload:2249:]]

When I view the posted node, there is a broken image icon - looking at the HTML source for the node, I see that [[wysiwyg_imageupload:2249:]] was converted to:

Only local images are allowed.

The correct URL though should be /sites/default/files/imagecache/Medium/Picture_032.jpg , though, correct? It seems strange for an image source to just be a directory -

Comments

newmediaist’s picture

I forgot that the Drupal.org input filter "filters out" html =)

From my previous post, the input filter is converting [[wysiwyg_imageupload:2249:]] to:

<img src="/sites/default/files/imagecache/Medium/" alt="2249" title="Picture_032.jpg"  class="wysiwyg_imageupload 0" style="" />

Here is the entry from the database table wysiwyg_imageupload_entity

iid | fid | nid | cid | temporary | imagecache | style | title | alignment
2249 | 3383 | 0 | 0 | 1 | Medium | 0 | Picture_032.jpg | imgupl_floating_none

And here is where the file appears in the filesystem:
/sites/default/files/imagecache/Large/wysiwyg_imageupload/1694/Picture_032.jpg
/sites/default/files/imagecache/Medium/wysiwyg_imageupload/1694/Picture_032.jpg
/sites/default/files/imagecache/wysiwyg_imageupload_preview/wysiwyg_imageupload/1694/Picture_032.jpg

I should also note that the images uploaded fine initially, and displayed fine initially as well - although we haven't done anything to the site in the last 24h, it appears as though they just stopped working (very suspicious) - probably after the next CRON run (just a guess)

Also, in the wysiwyg database table, what does "Temporary" mean, and why is it set to 1?

EugenMayer’s picture

Well your suggestion is correct.

temp is set on the initial upload. Until you dont save the node, the file will stay temp and will be removed after cache expire. On save though, the file will get permanent.
So it seems we have antoher issue where nodeapi save handler is not called, though the images stay temporary. Thats why your files are not working "randomly", or more precise after the cache clear.

What kind of nodes did you add those images too?

To be exact, after saving a node, every entry in the db for that node must have temp=0 - otherwise those images get removed.

I really have to thank you, its very rare that someone gives so detailed informations for debugging and actuall puts his own time into the issue before opening. Very apritiated.

newmediaist’s picture

No problem - I have to thank you for writing this module, and putting your time into it!

Node type was Forum post. I've also run into this issue with CCK nodes as well.

EugenMayer’s picture

Well i guess you have to debug it, as i cant properly reproduce it here.

We have to debug 2 things, or better, we could have to places of failure:

I guess you have to place some dpm() and see, what fails. Be sure to use the user, which caused the problem with other nodes before and grant him devel rights ( it could also be permissions related )

newmediaist’s picture

I'm having trouble recreating the "Temp=1" problem - every image I upload is changing to "Temp=0" after saving... the strange thing is this problem is now occurring on two sites of mine, each of which have different module setups, but sit on the same server.

By the way - does this bug mean the images which were uploaded are now lost? It sounds like the source files are being deleted by the cronjob unless temporary=0...

And on a semi-related note, I also noticed looking through the database that every single picture has two entries in wysiwyg_imageupload_entity - one which has the imagecache, style & alignment blank, and one which has is set to whatever the default settings are. Is it supposed to work that way?

EugenMayer’s picture

Well yes, this is getting ugly.

Well also the files are temporary uplaoded, that means they will get deleted by drupals file api during cron, thats rights (thats actually the idea of those temporary files).

No there should not be 2 entries for each picture until you dont use it twice. Every usage of a picture is an entry. ( Even in the same node ). So if you only have one usage of that picutre in one node, there should be exactly one entry. If thats not the case, that could be the path of the error probably.

EugenMayer’s picture

Well just to give you a checklist for reproduction:

  1. Be sure to use the same user (permission issues)
  2. Be sure to use the same content type ( forum, comment whatever )
  3. very important and ugly: Test all combination of submissions:
    1. Save->validation-error->Fix error->save
    2. Preview->validation-error->Fix error->save
    3. Preview->no validation error->save
    4. Save->no-validation error

Its important to test all cases, because they need to be covered due to very ugly form-api edgecases. Read about them in http://github.com/EugenMayer/wysiwyg_imageupload/blob/master/wysiwyg_ima...

Thats actually the issue i wait to be cleared before the 2.1 release, which currently only has very minor corrections and a new feature ( inline resizing ). This issue could be a major though

newmediaist’s picture

Ok - Regarding the "Create two rows in database" bug - Using Google Chrome w/CKEditor 3.3.1.5586 , logged in as a normal user w/ proper permissions:

1) Click the WYSIWYG Image Upload Icon

2) Click "Choose File". The Preview is shown, and TWO entries are added to wysiwyg_image_uploade_entity:
192 186 0 0 1 file1.jpg
193 186 0 0 1 file1.jpg

3) Click "Insert", and One of the Two entries are updated as follows:
192 186 0 0 1 file1.jpg
193 186 0 0 1 Large 0 file1.jpg imgupl_floating_none
(If I change the title of the image from the default file name BEFORE click Insert, then in the earlier record (192) it shows the file name, while in the secondary record (193) it shows the new updated title i entered)

4) Click "Save", and the following is the file rows left in the database
192 186 67 0 0 file1.jpg
193 186 67 0 0 Large 0 file1.jpg imgupl_floating_none

I cannot seem to trigger a scenario where two entries are not created - very strange!

EugenMayer’s picture

Thanks for the investigation, iam looking into that using a fresh install. Maybe i find time today

EugenMayer’s picture

Version: 6.x-2.0 » 6.x-2.1
Status: Active » Fixed

Finally i have fount time to get into this. A very odd behaivor of the drupal menu API was the cause mainly.

http://github.com/EugenMayer/wysiwyg_imageupload/commit/a91f2212ca68944d...
http://github.com/EugenMayer/wysiwyg_imageupload/commit/abf1577172b5147e...

should be working in the github master already and will be included in 2.2.
reopen if this still does not work out

newmediaist’s picture

Thanks, installed the update today hopefully it fixed the problem!

newmediaist’s picture

Installed the newest version, problem is still there... with "Temp=1" and images randomly getting deleted after CRON runs :( Big issue of course as it means when I update articles, I have to check back 24-48h laters to make sure the images "stick" and don't turn into Red X's. Unfortunately though I have no idea what is causing this issue, as it seems to be happening somewhat randomly even on clean installs, even on clean servers (i.e. - I am unable to trigger it manually so am having difficulty providing debug information)

It even seems to occur sometimes in scenarios where no special actions are taken - i.e. when you create a new node, insert and image, and just hit save.

Has anyone else experienced this problem, or is it just happening to me?

(*message updated with more info)

EugenMayer’s picture

Well i need more informations. I def. fixed the "double entry" issue and at least on of those missing nodeapi procedures.

EugenMayer’s picture

I guess thats you site : http://bulldogsworld.com/f/general-bulldog-forum/were-very-sorry-about-a...

If yes, well seems like you dont need any help anymore. Pretty disapointed about your way to communicate there, sounds like i never responded and you are not responsible for anything you do on your site.

cregar’s picture

I have the same issue.
When i add an image to a node (node-type "blog") the image is not shown on the posted node (instead a text like this: "[[wysiwyg_imageupload:4:]]"). When i click on "edit post" everything is working fine. So i can see the image during the upload process and in my body text.

My database table "wysiwyg_imageupload_entity" has the following entry:

iid | fid | nid | cid | temporary | imagecache | style | title | alignment
4 2761 854 0 0 Big 0 picture.jpg imgupl_floating_none

Thanks for help.

EugenMayer’s picture

Cregar your issue is totaly different...

read the installation docs and activate the Drupal Wiki Inlne Image input filter...

onewayticket’s picture

Status: Fixed » Active

Unfortunately, I'm running version 6.x.2.2 and the problem that newmediaist found is still occurring as far as I can see it. I get these sort of URLs http://www.mysite.co.uk/sites/default/files/imagecache/width_640px/ which is missing the filename and sub-directories.

The image uploads fine to the server and is shown on the preview. It even saves the page correctly but then a day later the images are missing and I have to upload them again. There appears to be problems with cron and saving the file. I've been running my server to update cron every 5 minutes which could have something to do with it. It also seems to happen more with new pages, rather than pages already saved which is weird. Makes me think that if the cron runs too frequently and you haven't saved the page, then it loses the URL information.

I'd really appreciate some advice on the issue as it's really bothering me. Thanks for the module btw!

EugenMayer’s picture

well i found an issue which will be released in 2.2 but iam still not 100% it covers the edge case. The problem is, its really hard to reproduce.

EugenMayer’s picture

Version: 6.x-2.1 » 6.x-2.2
Status: Active » Fixed

Finally i found it, iam pretty sure. Its bound to the way i set the cace (CACHE_TEMPORARY) and the timing when a cron runs. I changed the form cache to be permanent and delete it when i save the node in the nodeapi.

There was alos a browser bug which could cause this.

onewayticket’s picture

Thanks for all your effort in helping me out EugenMayer. Just noticed the new 2.3 version on the site, so I guess this will have the fix included? Thanks again, really appreciate this bug fix. Drupal without an image uploader in the WYSIWYG is so frustrating.

EugenMayer’s picture

Yes 2.3 includes this

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Erika123’s picture

This seems to be the same problem, but I don't really understand what is said in much of the comments above, and I'm not sure if I should create a new issue or use this one.

After clicking on browse and selecting the file, the "Image Details" panel shows a number (eg 133) the alternative text for the image.

At that point the file has actually been placed into sites/default/files/wysiwig_imageupload/ (followed by [uid]/filename.jpg)

When I click "Insert" there is a broken image picture. When I click on it and select "Image Properties" it shows that it is looking at the url sites/default/files/imagecache/600px_wide/wysiwyg_imageupload/1/filename.jpg

When I save and then edit, then look at the content without rich text, it shows: [[wysiwyg_imageupload:133:]]

Using drupal 6.19
wysiwig image upload 6.x 2.8
jquery update 1.3.2 in status report, ( module 6.x-2.0-alpha1)
jquery ui 1.7.3 (6.x 1.4)
Jquery UI Dialog 6.x-1.10

Thank you for the great module, it really makes it easy for clients! I did have it working up to a few months ago, and I'm not sure what happened so that now it doesn't work. I updated to a different server, but the hosting company said that they checked the permissions.

EugenMayer’s picture

Open a new issue, describe detailed what happens, maybe include Screenshots. Thanks

boftx’s picture

The maintainer of this module clearly has no sympathy for new users or even for those who WANT this module to work.

I encountered the same that many are reporting, and after reading his replies I have deleted the package from my system and will go with something else. I am a software engineer by trade whose main area of expertise in a language other than PHP.

I find Eugen Mayer's responses and attitude to all of you to be inexcusable and I strongly you to use a different package.

EugenMayer’s picture

Botfx do you actually maintain any modules?
Do you

  • ..spend you time for free for the sake of the community? In any point?
  • ..answer the same questions again and again, eventhough they are
    1. In the documentation
    2. in the FAQ
    3. in 10 other issues?
  • Answer and work on this issues on behalf of you free time?
  • try to invest more then 2 minutes installing a module and read the documentation??
  • ..writing up documentation for things you dont need to document for yourself?
  • ..writing howto`s to clarify how things should work
  • ..and see people ignore all this work and simply ASK the same question again and again without even try to invest 5 minutes of reading?

You have absolutely no respect for the work a maintainer does while developing and maintaining the module, developing features and ASK support questions he should actually not care at all? Why should he even ask and help others debug there system to find out the have memory usage problems, crappy modules installed braking X, Y, Z or similar? Do you really think thats the correct way to go? Could it be rather the case, that its the _developer_ of the site, whos job that is? Isnt it what he gets money for, not me? Is that what he is resposible to and what he admitted to when using open source software?

If you think you can do it any better, go forward. But pissing on other persons shoes without having a slightly clue about what they do is most probably the wrong way.

Do you really think _I_ need you to use this module? Or might it the other way arround, i give you the oppertunity to use the module as i released it and maintain it for the wide range of users?

No comment.

blueprint’s picture

As I've mentioned elsewhere: 1. Well written and complete instructions that non-cli users can follow and the drush make works! Yipee. I was really tired of imce and the bridge ...