Hi Quicksketch,
I'm doing a bit of testing on a site I have running the Insert module and I noticed that if you upload an image, preview the node, then insert the image it will insert an empty image.
I looked into this further and discovered that due to the changes in $element['value'] in insert_process(), insert_content() was returning bad data. I also discovered that $element['value'] contained the the previous already created insert_template data, so I came up with an extremely simple fix:
Change insert.module line 198 from:
'#value' => insert_content($item, $style, $field['widget']),
to:
'#value' => isset($item['insert_template'][$style_name]) ? $item['insert_template'][$style_name] : insert_content($item, $style, $field['widget']),
Also attached as a WinMerge generated patch, best I could do in my current work environment.
Cheers,
Deciphered.
| Comment | File | Size | Author |
|---|---|---|---|
| insert-6.x-1.0-beta2-preview_insert-1.patch | 790 bytes | deciphered |
Comments
Comment #1
quicksketchHey Deciphered. Thanks for the patch but I can't reproduce this problem on a clean install. Is there anything special about your configuration? I'm about to put out a beta3 version, could you let me know if the problem still exists in it (or in the latest CVS version)?
Comment #2
decipheredHi quicksketch,
The install that this occurred on is at my place of work, which I don't have access to on the weekend.
I did attempt to reproduce the issue with a fresh install but was unable to, so it's possibly related to the server environment, additional modules or something else specific to that install.
I will have a go at it on Monday and let you know what I find.
Cheers,
Deciphered.
Comment #3
decipheredCan no longer reproduce this issue on the site originally discovered, so marking as closed.
Cheers,
Deciphered.