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

ericG - June 12, 2006 - 22:54

Looks like this bug is causing problems with CCK also:

http://drupal.org/node/68632

#2

Bèr Kessels - June 13, 2006 - 00:21

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

#3

Bèr Kessels - June 13, 2006 - 00:22

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

#4

ericG - June 13, 2006 - 13:28

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

#5

halkeye - June 22, 2006 - 23:45

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

AttachmentSize
drupal.quicktags.img_assist.patch.txt 772 bytes

#6

Bèr Kessels - June 23, 2006 - 13:46
Version:4.7.x-1.x-dev» HEAD
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

#7

halkeye - June 23, 2006 - 16:17

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

kost - July 9, 2006 - 20:42

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

#9

naudefj - July 11, 2006 - 20:47
Status:needs review» needs work

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

#10

halkeye - July 12, 2006 - 04:39

you using cvs or 4.7? patch was for cvs

#11

naudefj - July 12, 2006 - 06:17
Status:needs work» needs review

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

#12

ericG - July 27, 2006 - 21:36

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

Bèr Kessels - July 28, 2006 - 10:08
Status:needs review» needs work

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

#14

halkeye - July 28, 2006 - 19:24
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.

#15

ericG - July 30, 2006 - 14:40

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

ericG - July 31, 2006 - 15:40
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);

#17

ericG - July 31, 2006 - 21:16
Title:correction» conflict with img_assist module

#18

ericG - August 1, 2006 - 14:02

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

AttachmentSize
quicktags.img_assist.patch_fix.txt 777 bytes

#19

Bèr Kessels - August 1, 2006 - 15:19
Status:needs review» needs work

So that means the patch needs to be updated.

#20

Bèr Kessels - August 1, 2006 - 18:36
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?

#21

advosuzi - August 8, 2006 - 15:40

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

lennart - August 28, 2006 - 09:45

Works for me! Thanks.

#23

catch - October 14, 2006 - 12:03
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.

#24

Bèr Kessels - October 18, 2006 - 17:12
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

 
 

Drupal is a registered trademark of Dries Buytaert.