Closed (fixed)
Project:
Insert
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2009 at 00:07 UTC
Updated:
21 Aug 2010 at 18:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchSlate is probably changing the HTML in a way that makes it so that Insert can no longer operate, since it is dependent on HTML classes to operate properly. I'll see what it's doing, but this very well could be a problem with Slate (which does all sorts of really drastic changes).
Comment #2
PieWie commentedI hew the same
by clicking the insert button i become
<img src="" width="" height="" alt="" title="" />i use
Insert 6.x-1.0-beta2
ImageField 6.x-3.2
Image Resize Filter 6.x-1.5
FileField Paths 6.x-1.3
FileField 6.x-3.2
Content Construction Kit (CCK) 6.x-2.6
Comment #3
andrew_kabai commentedi can also confirm the bug.
if i upload something (cck filefield) then the insert options is available, but it makes empty links or img html tags without src.
i use the following modules:
cck 6.x-2.6
filefield 6.x-3.2
imagefield 6.x-3.2
filefield paths 6.x-1.3
insert 6.x-1.0-beta2
Comment #4
jsm174 commentedI can also confirm this.
I have two insert styles, an imagecache "resize-200-200" and "fancybox-resize-200-200" (dynamic from fancybox d6 module).
If I am creating a new node, and upload a new image, I can insert into CKEditor with no problem, either style.
If I come back to edit the node, and try to insert the existing image again using the resize-200-200 style, it comes back empty with
If I try to use the fancybox-resize-200-200, it comes back correctly with
So it seems as if there may be an issue with a plain imagecache insert while editing an existing node.
-- Jason
Comment #5
jsm174 commentedI have another update.
I just tried another edit. If I click the imagefield I want to reuse, and then click "Reference existing" (filefield sources) and then Select (to use the existing FID), I can continue inserting both styles with no problems.
Comment #6
PieWie commentedUnfortunately, despite the addition of the module filefield sources
with me on the path src is empty
and i do not use any editor viswig
Comment #7
johngriffin commentedI am having the same problem. I'd be happy to help debug if you can give me some hints on where to look, I don't have a great deal of time to investigate though right now.
I have just updated from filefield_insert to insert, I have the latest stable versions of cck (6.x-2.6), filefield (6.x-3.2) and imagefield (6.x-3.2)
It appears that when I try to use "Insert" on a filefield which already contained a file before the upgrade, the following is inserted into the body:
<img src="" width="" height="" alt="" title="" />If I upload a new file and then try to use Insert it works as expected.
Comment #8
trevortwining commentedIt looks like when slate is enabled maxwidth or the other values don't get set in the insert() function on line 34 of insert.js. I'm still grokking the code at this point but here's what an output of all the properties in settings looks like
Comment #9
trevortwining commentedadjusting title due to premature submit
Comment #10
mortendk commentedNot a pretty solution ... but a solution ;)
So heres the problem:
The slate theme (or is it admin that does that ?) overwrites the preprocess functions that **insert module** uses for adding the options in the hidden fields for each of the files that are uploaded (apperently this is not the case when a file is just uploaded)
So to overwrite that just add the preprocess functions into admin template.php file
admin/template.tpl
This is for the 1.0 branch of admin module havent look into it yet in the 2.0
also reported here http://drupal.org/node/649742
Comment #11
malclocke commentedVery similar problem to johngriffin here. After upgrade from filefield_insert I get
<img src="" width="" height="" alt="" title="" />tags created by 'Insert'. Difference in my case is that no inserts work, either old pre upgrade images or newly uploaded ones.Problem seems to be that I am never getting into template_preprocess_insert_image() at includes/insert.inc:44, some debug print statements in there never get called. If I copy the preprocess code to mytheme_preprocess_insert_image() everything works.
Bizarrely, 'grep -rl preprocess_insert_image .' from my site root doesn't find any other occurrences of that preprocess function. What other candidates could be stopping the preprocess from running?
Site is using cck 6.x-2.5, filefield 6.x-3.2, imagefield 6.x-3.1 and a zen 6.x-1.0 sub theme.
Comment #12
giorgoskThe problem occurs with more themes than just slate
I am using a subtheme of adaptivetheme 2.x
solution in #10 worked for me for original image not for imagecache presets though
NOTE: that if I use
phptemplate_preprocess_insert_imageinstead ofTHEMENAME_preprocess_insert_imageand similarly the rest the insert does not workComment #13
quicksketchNow that I see what the problem is, I don't think there's much that Insert module can do. The fact that Slate (Admin module 1.x) and the Adaptive Theme abuse the theme system in completely unholy ways is a problem with those themes, not a problem with Insert. I don't think there's anything that can be done by Insert other than not using .tpl.php files, which would be a step backward. The 2.x version of Admin module should be much cleaner because it doesn't jam an admin theme into your site through a series of ridiculous hacks. I'm not sure what to say about Adaptive Theme since I have never used it.
Comment #14
mason@thecodingdesigner.com commentedsubscribe
Comment #15
mark. commented.
Comment #16
jrefano commentedI took morten's code and made a quick module for anyone who is using Admin/Slate and Insert, so you can just drop it in and enable it. Note that this fix has only been tested on Admin 1.x.
Comment #17
perandre commentedHm, couldn't make it work with admin 1 beta 3.
Edit: Nevermind; didn't work with Admin module disabled, either.
Comment #18
grantkrugerWhat does not entirely make sense is how it was working fine and then stopped working somewhere along the way. In my case I'm using Admin with Slate and Tendu (a Zen variant). Admin module's recommended version is what I'm using and it was last updated 2009-Jul-30, whereas Insert has been updated many times since then. Further, in my case it seems to work sometimes, but not others. Sometimes it inserts a blank image and other times it points to a thumbnail that was never created. It's all a little beyond me.
So do we now have an either or on Admin and Insert? Recommendations?
EDIT: Okay, my problem seems to have gone away. I can't be specific, because I changed a lot of settings, but I can say that I was having some ImageCache and Lightbox2 issues. Which means I appear to have Insert working with Admin. Further, as an oddity, my Mac allows an ampersand (&) in file names, but most image modules behaved very strangely when an & is in a file name. I suspect there is a security hole in the mix. All of this is just FYI.
Comment #19
jedihe commentedI've found this problem too, using Admin module 1.0 beta 3. In my case, insertion worked when creating the node, but not when editing it (the wysiwyg received an img tag only with the class attribute, no src).
The good news is I just upgraded to Admin 2.0Beta1 + Rubik Theme and now insert works nicely.
jedihe
Comment #20
btc97 commentedI had this same issue: none of my image urls were inserted after switching from Filefield Insert to Insert. My custom theme doesn't override any preprocess insert function, as far as I can see, so I'm still not sure what caused this... Another module?
Comment #21
giorgoskuse #10 function in your template.php with with name such as phptemplate_preprocess_insert_ or THEMENAME_preprocess_insert_
Comment #22
quicksketchI think this problem may have been fixed as part of #739280: Unregistered preprocess functions. I'm making a beta4 release today, please reopen if this problem still exists in that version.
Comment #23
kevinwalsh commentedI updated to beta4 but the issue persists, using a theme based on Acquia Marina. Solved with Morten's fix at #10
Comment #24
quicksketchThanks kevinwalsh for the update. So, still not much to be done by us it seems. :-(
Comment #25
perandre commentedOn a related note: I've had problems inserting files in general into the wysiwyg on some occations. After changing DEFAULT INSERT STYLE: Automatic -> Link to file, it started working.
Comment #26
JJG commentedI think i have the same problem the insert option doesnt appear in the "manage fields" that really sucks since im using lullabot videos and their theme to follow what they do in the videos
Comment #27
entrigan commentedI had this problem until downgrading to beta4 from dev
Comment #28
apolitsin commentedthis problem too
Comment #29
apolitsin commentedthis code works:
/sites/all/modules/insert/includes/imagecache.inc
line 23-...
/sites/all/modules/insert/insert.module
line 71
'arguments' => array('item' => NULL, 'widget' => NULL, 'preset_name' => NULL, 'url' => NULL),желаю всем счастья, любви и удачи! =)
Comment #30
PieWie commentedfor me it does not work :(
i still do not have the path to file
<img src="" alt="" title="" class="imagecache-manual" />Comment #31
apolitsin commentedhave you flush cache?
Comment #32
PieWie commentedyes
I also have a problem now with the right to the directory "files"
although the law has 777 drupal does not see those rights
may be something else is wrong
I do not know where to look for reasons
Comment #33
Melissamcewen commentedI'm having this problem as well. N-thing "What does not entirely make sense is how it was working fine and then stopped working somewhere along the way."
Comment #34
echoz commentedI want to add to this issue with what I hope is a clue, although may be for the other involved module, where I will post as well. We have insert working flawlessly, then after installing SimpleMenu 6.x-1.7 http://drupal.org/project/simplemenu, we get an empty image tag
<img class="imagecache-large" alt="">Based on a SimpleMenu js bug report #837956: Simplemenu 1.5 to 1.8 breaks javascript sitewide (if files is not created, old behavior does not take over automatically.) downgrading to SimpleMenu 1.4 allows insert to function normally again. Edit: The dev version from 7/1 of simplemenu resolves this issue.
I tested with today's updates of filefield 6.x-3.7 + imagefield 6.x-3.7 with no change.
Comment #35
zroger commentedThis is actually a bug in the hook_theme implementation. I figured it out by inspecting the theme registry using the devel module. Here's what i found. http://skitch.com/zroger/dqhiw/theme-registry-optionsprofits
The patch fixes the hook_theme implementation.
Comment #36
quicksketchWow, yikes! Thanks Roger! I'll put this in and make a new release.
Comment #37
mstrelan commentedWhen is this new release coming? This is really critical for insert to work correctly.
Comment #38
divbox commentedI just came across something, which, in the end was simple to resolve, but took a while to figure out.
I was having a similar problem, where I would click insert, but nothing would go to the text area.
I have set up my own template on a node add form, so I am not using the standard node/add form. Perhaps it was how I output the form (drupal_render), but I ended up w/out a wrapping
<div class="node-form">around my form. Without this, the jquery function did not fire
$('.node-form textarea:not([name$="[data][title]"])', context).focus(insertSetActive).blur(insertRemoveActive);Looking at insert.js, I think this may be due to me using ckeditor module, instead of wyswyig api module and ckeditor, but I'm not 100% sure.
Hopefully this helps someone
Comment #39
quicksketchI've committed the patch from #35. Thanks zroger!