Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#18 | quicktags.img_assist.patch_fix.txt | 777 bytes | ericG |
#5 | drupal.quicktags.img_assist.patch.txt | 772 bytes | halkeye |
Comments
Comment #1
ericG CreditAttribution: ericG commentedLooks like this bug is causing problems with CCK also:
http://drupal.org/node/68632
Comment #2
Bèr Kessels CreditAttribution: Bèr Kessels commentedHint: CCK had to abuse a theme function. Ugly, but it works. Looks like this bug is caused by that.
Comment #3
Bèr Kessels CreditAttribution: Bèr Kessels commentedThat should have been:
" ... Hint: Quicktags had t".
Comment #4
ericG CreditAttribution: ericG commentedThanks for that info.
I'll dig around
function theme_quicktags_textfield
and see if I can't find a fix.
Comment #5
halkeye CreditAttribution: halkeye commentedTurns 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 :)
Comment #6
Bèr Kessels CreditAttribution: Bèr Kessels commentedLooks 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
Comment #7
halkeye CreditAttribution: halkeye commentedyou 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.
Comment #8
kost CreditAttribution: kost commentedAfter applying this patch, all textarea nemrs turned into "Array:", instead of it's normal name.
Comment #9
naudefj CreditAttribution: naudefj commentedSame problem - textarea names are shown are "Array:".
Comment #10
halkeye CreditAttribution: halkeye commentedyou using cvs or 4.7? patch was for cvs
Comment #11
naudefj CreditAttribution: naudefj commentedOops - sorry! I've applied the patch against 4.7.
Comment #12
ericG CreditAttribution: ericG commentedThanks 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.
Comment #13
Bèr Kessels CreditAttribution: Bèr Kessels commentedThe patch needs to fix the addressed "Array:" bugs first.
Comment #14
halkeye CreditAttribution: halkeye commentedActually, I already submitted a patch for that
http://drupal.org/node/70385
Thats a different issue, this is the img_assist issue.
Comment #15
ericG CreditAttribution: ericG commentedin 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?
Comment #16
ericG CreditAttribution: ericG commentedwas 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);
Comment #17
ericG CreditAttribution: ericG commentedComment #18
ericG CreditAttribution: ericG commentedattached is halkeye's patch with my fix as described above
Comment #19
Bèr Kessels CreditAttribution: Bèr Kessels commentedSo that means the patch needs to be updated.
Comment #20
Bèr Kessels CreditAttribution: Bèr Kessels commentedMy 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?
Comment #21
advosuzi CreditAttribution: advosuzi commentedThis 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
Comment #22
lennart CreditAttribution: lennart commentedWorks for me! Thanks.
Comment #23
catchJust 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.
Comment #24
Bèr Kessels CreditAttribution: Bèr Kessels commentedThe 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