conflict with img_assist module
ericG - June 8, 2006 - 19:40
| Project: | quicktags |
| Version: | HEAD |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
On two different sites, on two different servers, I have noticed that if I have quicktags and img_assist both enabled that the img_assist "add image" link will not show up. Turning off quicktags fixes the problem.

#1
Looks like this bug is causing problems with CCK also:
http://drupal.org/node/68632
#2
Hint: CCK had to abuse a theme function. Ugly, but it works. Looks like this bug is caused by that.
#3
That should have been:
" ... Hint: Quicktags had t".
#4
Thanks for that info.
I'll dig around
function theme_quicktags_textfield
and see if I can't find a fix.
#5
Turns out that img_assist uses #suffix, and your theming function didn't use it.
Patch
16:32 < halkeye> why does fapi's form_render unset #suffix if a themeing function is used?
16:33 < Heine> because the theme probably doesn't want the prefix and suffix output
16:34 < halkeye> sounds like a good enough reason
16:34 < Heine> It would be unthemeable, so it has to be unset
16:36 < halkeye> *nods* make sense, and the theme function could theme it
16:36 < Heine> glad I make sense :)
#6
Looks good. And will commit if I (or someone else) has time to test it.
But about img_assist: How about implementing a Very Simple hook_quicktags() in img_assist?
More info here: http://webschuur.com/node/628
#7
you should contact the maintainer http://drupal.org/user/6521/contact
and i'm wondering about the last 2 lines of the patch, maybe it shouldn't have the if check, and just return $prefix . $content . $suffix.
#8
After applying this patch, all textarea nemrs turned into "Array:", instead of it's normal name.
#9
Same problem - textarea names are shown are "Array:".
#10
you using cvs or 4.7? patch was for cvs
#11
Oops - sorry! I've applied the patch against 4.7.
#12
Thanks for the patch.
When I applied it (to the CVS quicktags module) I still get the form field name replaced by Array
I think that
in your patch
$content = theme('form_element', $element, $html);
needs to be
$content = theme('form_element', $element['#title'], $html);
or at least making that change worked for me.
#13
The patch needs to fix the addressed "Array:" bugs first.
#14
Actually, I already submitted a patch for that
http://drupal.org/node/70385
Thats a different issue, this is the img_assist issue.
#15
in the patch you link to I see
- return theme('form_element', $element['#title'], $html);
+ return theme('form_element', $element, $html);
If I am reading this right, you are doing the exact opposite of what I suggested above (if my assumption is correct that in a patch lines prefixed with - get removed and those prefixed with + get added).
to make your patch work, I had to
remove
return theme('form_element', $element, $html);
and replace it with
return theme('form_element', $element['#title'], $html);
otherwise you are theming an array and not the title of the form field, right?
#16
was not thinking when I wrote the above comment.
to correct myself:
To make the patch work I had to replace
$content = theme('form_element', $element, $html);
with
$content = theme('form_element', $element['#title'], $html);
#17
#18
attached is halkeye's patch with my fix as described above
#19
So that means the patch needs to be updated.
#20
My change in status was meant for #16. I did not notice the updates after that. Sorry.
Can someone review the latest patch by ericG in #18 please?
#21
This patch (applied manually) fixed the image assist bug for me in quicktags 4.7.
Tried to load CVS version of quicktags to test but you've got a bug on line 143:
}cvs ci#22
Works for me! Thanks.
#23
Just applied the patch manually to drupal 4.7.3 and october 10th version of quicktags 4.7 and it works perfectly for me. Not sure of the etiquette for changing status, but changed to ready to be committed.
#24
The patch fails for HEAD. please make sure it is up to date :)
ber@penelope:~/repository/contributions/modules/quicktags$ patch -p0 < quicktags.img_assist.patch_fix.txt
patching file quicktags.module
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 67.
1 out of 1 hunk FAILED -- saving rejects to file quicktags.module.rej