If you activate http://drupal.org/project/cufon
better messages is not working anymore.

Comments

mohammed j. razem’s picture

Title: Contribute Module conflict Cufon » Cufon module disables $closure in preprocess_page function
Project: Better Messages » Cufón
Version: 6.x-1.9 » 6.x-1.0-beta4
Component: User interface » Code
Priority: Normal » Critical

Hi,

When activating Cufon, every module that outputs anything in $closure will be broken. I noticed the line $vars['closure'] = theme('closure'); in function cufon_preprocess_page(&$vars) which does nothing but break other modules.

If you want to output anything in $vars['closure'] = theme('closure'); please use hook_footer

mohammed j. razem’s picture

Remove $vars['closure'] = theme('closure');

in cufon.module in line 112.

ghazlewood’s picture

Yeah what doublethink said, this module is causing the google_analytics module to output the tracking code twice! Eeek! Anyone having strange problems with their $closure region should comment or remove line 112 of cufon.module

I'd patch but it's a pretty simple fix! Here's hoping the maintainer comes out of hibernation soon ;)

electblake’s picture

yeah, anything that uses $closure (in my case better_messages weren't displaying) - removing the seemingly pointless $vars['closure'] call frees up other modules from accessing $closure again.

miceno’s picture

Same problem for me. Enabling Cufon and then better_messages are not displayed ;(

Any other fix for this?

Shaney’s picture

Status: Active » Needs review
StatusFileSize
new982 bytes

I encountered this too. I've attached a patch that uses hook_footer() to replace what was being done in the preprocessor function. this removes the need to rerender theme('closure') which causes duplicate js to be added for any module (inc. google_analytics) that adds js in its hook_footer().

It still rerenders the scripts variable which should not be a problem and may be needed.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Works for me (had a duplication of Google Analytics code as a result of this issue). Marking as reviewed.

Anonymous’s picture

Works for me, too!

aiphes’s picture

i've applied this patch, but how to know if the code work ? before to see result in GA page...and to be sure there is no problem ...

mohammed j. razem’s picture

Try installing Better Messages module. Will it work?

aiphes’s picture

ok i've enabled better messages, but i dont know what the plus...and disabled cufon...no need because i use css properties for typos..will see if events and search tracking works

EDIT: no result, events are still empty..i dont know what thinking about that...

vinmassaro’s picture

I've applied this patch and while it stops Google Analytics code from printing twice, it has stopped Cufon from functioning. I did have success with the patch from this thread: http://drupal.org/node/591838

blackice2999’s picture

StatusFileSize
new2.16 KB

hi,

same here theme('closure') broken some modules. I have removed the theme function and moved the selectos js to init function. it´s works fine for me.

best regards
Dennis

JamieR’s picture

The google analytics duplication issue happened for us as well. I hope this patch gets into the module soon.
Cheers! Jamie.

EvanDonovan’s picture

The patch from #591838: Makes the Google analytics pagetracker print twice (need to remove the reset of $closure from preprocess_page) is cleaner than the one in #734630-13: Cufon module disables $closure in preprocess_page function, and should be the one applied to this module.

This is absolutely critical to be committed, and a one-liner fix. Can it be committed ASAP, and a new release rolled?

Thanks so much for the module, btw :)

fonant’s picture

removing the single line

$vars['closure'] = theme('closure');

works fine here.

EvanDonovan’s picture

Status: Reviewed & tested by the community » Closed (duplicate)