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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericG’s picture

Looks like this bug is causing problems with CCK also:

http://drupal.org/node/68632

Bèr Kessels’s picture

Hint: CCK had to abuse a theme function. Ugly, but it works. Looks like this bug is caused by that.

Bèr Kessels’s picture

That should have been:
" ... Hint: Quicktags had t".

ericG’s picture

Thanks for that info.
I'll dig around
function theme_quicktags_textfield
and see if I can't find a fix.

halkeye’s picture

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 :)

Bèr Kessels’s picture

Version: 4.7.x-1.x-dev » master
Status: Active » Needs review

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

halkeye’s picture

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.

kost’s picture

After applying this patch, all textarea nemrs turned into "Array:", instead of it's normal name.

naudefj’s picture

Status: Needs review » Needs work

Same problem - textarea names are shown are "Array:".

halkeye’s picture

you using cvs or 4.7? patch was for cvs

naudefj’s picture

Status: Needs work » Needs review

Oops - sorry! I've applied the patch against 4.7.

ericG’s picture

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.

Bèr Kessels’s picture

Status: Needs review » Needs work

The patch needs to fix the addressed "Array:" bugs first.

halkeye’s picture

Status: Needs work » Needs review

Actually, I already submitted a patch for that
http://drupal.org/node/70385

Thats a different issue, this is the img_assist issue.

ericG’s picture

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?

ericG’s picture

Title: conflict with img_assist module » correction

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);

ericG’s picture

Title: correction » conflict with img_assist module
ericG’s picture

attached is halkeye's patch with my fix as described above

Bèr Kessels’s picture

Status: Needs review » Needs work

So that means the patch needs to be updated.

Bèr Kessels’s picture

Status: Needs work » Needs review

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?

advosuzi’s picture

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

lennart’s picture

Works for me! Thanks.

catch’s picture

Status: Needs review » Reviewed & tested by the community

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.

Bèr Kessels’s picture

Status: Reviewed & tested by the community » Needs work

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