The current implementation of the module places double quotes around all variable names. This creates a problem when the variable name itself is additional javascript that needs to be processed as in the following from a SiteCatalyst code version: H.15.1 sample:

s.prop15=s.prop9+'-'+s.prop12+'-'+s.prop13+'-'+s.prop8+'-'+s.prop14;

This patch removes the quotes from both the administrative interface input and the api input so that they must be explicitly written for strings.

Comments

cyberswat’s picture

StatusFileSize
new4.47 KB
cyberswat’s picture

and p.s. ... this patch isn't really that large but my editor stripped all the trailing whitespace off the lines.

greggles’s picture

Since this breaks functionality it seems like we should document it.

On the other hand, there's really not anybody using this version -- http://drupal.org/project/usage/omniture -- so what the heck, let's do it.

Race.it’s picture

would it be better to perform the writing out of the javascript via the drupal_add_js() function, then we could push out the omniture variables in a safe way.

for example

$settings = array('omniture' => array('page' => 'node'));

drupal_add_js('setting', $settings);

Drupal.omniture.page
greggles’s picture

I'm not much of a js person so I can't agree/disagree with the approach. If it works it seems like a much more "Drupal way" approach.

cyberswat’s picture

StatusFileSize
new1006 bytes

I re-rolled the previous patch without all the extra garbage in it because it hurt my head when I looked at it.

I also think it might be more drupalish to use drupal_add_js (which is a seperate issue) ... It's been a while since I've worked with omniture so I would suggest care be taken that the formatting they require is preserved.