This one was a major headache to figure out:
* Install CCK dev, imagefield dev, subscriptions 2.0
* Configure a content type to have an image field
* Try creating a new node with an image upload - the image will not appear
* If you edit and resave the node the image will appear
* Disable subscriptions
* Try creating a new node with an image upload - the image will now appear!
So what is happening? I don't know for sure - I have checked that imagefield is building the themed image tag correctly in #value in the node object, but by the time it reaches the theme the #value has become blank. If you apply the attached patch to subscriptions you can confirm that it is indeed the node_load that is causing the issue. I am pretty sure that modules are 'allowed' to call node_load() at this point however and so the issue seems to really be with imagefield (rather than subscriptions).
Could someone who has a better idea of the imagefield workflow have a look at what might be causing this? It looks like somehow imagefield is doing something in op 'load' that is overwriting the #value (already generated on op 'view') when the node is reloaded mid stream like this.
| Comment | File | Size | Author |
|---|---|---|---|
| nodeload_0_0.patch | 1.29 KB | owen barton |
Comments
Comment #1
owen barton commentedI have added an intentional dupe of this issue over at subscriptions to help people find this:
http://drupal.org/node/183650
Comment #2
Coyote commentedThis is not just affecting subscriptions module. If you are using the nodeprofile module, any content types set to be nodeprofiles have this behavior happen to them.
I think in nodeprofile's case, if it's the same sort of problem, it's not happening in nodeapi, but probably hook_user (but I'm not sure yet).
I will also post to the nodeprofile bugs and feature requests, in case this is something that needs to be addressed on their end.
Comment #3
Coyote commentedPosted about the problem here:
http://drupal.org/node/185022
I didn't make a new thread for the nodeprofile thing, since I'm fairly sure the problem is related to this one.
Comment #4
owen barton commentedsee also http://drupal.org/node/185505 (looks related)
Comment #5
fylia commentedI seem to have about the same problem, however the situation is a little different.
I use an imagefield with multiple values to create a photoalbum.
With a small number of images this seems to work, but I noticed that when the number of images grows above 30 something, there's a problem when trying to upload multiple images.
I can upload 1 image at a time when I browse for the image and then save the node. (using the save button) This works.
But when I try to upload the message before saving it (using the upload button), the image doesn't get uploaded and I don't see the preview image.
I added quite some debugging information and tracing to the imagefield to figure out what the problem is. It seems that the correct HTML is returned to the browser, but immediately afterwards the node gets reloaded from the database and thus all not-saved data is lost.
Comment #6
moshe weitzman commentedI have Preview troubles as well. Bumping to critical. This is pretty hard to track down.
Comment #7
fylia commentedMy problem seems to be firefox specific. In a different browser (Opera, Safari or MSIE) this problem doesn't occur???
Anyway, when I need to upload a large amount of images I use a different browser now...
Comment #8
owen barton commentedIt would be interesting to try and trim the 2 modules down to get an ultra-simplified test case. This way we should be able to track down where the actual problem lies.
Comment #9
drewish commentedlooks like this should be in the subscriptions module queue.
Comment #10
salvisMy answer remains the same as it was a year ago: http://drupal.org/node/183650#comment-644610, where Grugnog2 failed to follow up.
drewish correctly tagged this as Subscriptions 5.x-1.x-dev, which was never supported in any way (and probably doesn't even have an upgrade path).
After reading the various linked issues, I doubt that this is related to Subscriptions specifically, and I'm not going to investigate any 5.x-1.x-dev issues.
If anyone wants to pursue this, get current versions of Drupal and all the modules involved and post your findings in a new issue.