Using cufon generates 2 different javascript errors in IE and FF. Cufon still renders the text, but the error breaks all of the following javascript.

In IE, the error is:

Message: 'B' is null or not an object
Line: 7
Char: 6941
Code: 0
URI: http://mysite.com/sites/all/modules/cufon/js/cufon-yui.js?J

This is obviously a cufon error. In FF, I suspect that this error (the only error I receive) is related:

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: http://grasmickwebdesign.com/sites/all/modules/cufon/js/cufon-yui.js?J :: anonymous :: line 7"  data: no]

Any ideas on what could be causing this?

Thanks!

Comments

apt94jesse’s picture

I encountered the same error however the "Null" line gave me the clue to fix it.

In my case, I had several cufon selectors in the module settings page, then I removed one, but I forgot to take the font out of the select box on the right. That meant it was trying to apply a font to no selector, or null. Removing the font from the dropdown fixed the issue right away.

FYI, you probably had the error in chrome too. I initially thought it was just FF and IE, but using the Chrome js console revealed it was happening across the board.

Hope this helps, I don't think it's really a bug that needs to be fixed in the module, although error-proofing the form so that if a selector is not input, the font is removed from the dropdown might avoid confusion in the future.

grasmash’s picture

You're right! That absolutely fixed the problem. Thank you!

gateone’s picture

Confirming this. Great hint - this really happens quite often when developing! ;-)

maedi’s picture

Cufon should probably throw a validation error when saving an empty field with a corresponding font selected. Let me know if you'd like a patch.

troky’s picture

Status: Active » Fixed

Probably fixed in 6.x-1.x-dev.

Re-open issue if problem persists.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.