Comments

Race.it’s picture

I would say as a sub module that would be handy

e2thex’s picture

Yeah that was what I was thinking, but it is also small, and nothing bad happens if context is not installed, so it could also be add to the core module. and then would only be used when someone also installed context

greggles’s picture

Either way seems good to me. The code is less than 100 lines including white space and comments.

e2thex’s picture

Ok I will work it up as a patch and then you all can take it whatever way you want

febbraro’s picture

sub

e2thex’s picture

Ok I ported it to a patch (the second patch is on that can be used with drush make)

I am wandering if I am setting the variables incorrectly, I am setting then by passing the variables and values back from hook_omniture_variables.

Should I be instead setting then each using omniture_set_variables?

e2thex’s picture

Update the patch and add on check to the variable adding

e2thex’s picture

The last patch droped the context reaction class

e2thex’s picture

Ok that had an extra file in it

e2thex’s picture

Removed param form execute method of context reaction as it was not used

bleen’s picture

StatusFileSize
new4.11 KB

same patch as #10 w/o white space issues

bleen’s picture

Status: Active » Needs review
bleen’s picture

StatusFileSize
new11.92 KB

This patch includes the code from the patch found here: #1791670: Allow sites to include variables (with token replacement) from the Omniture settings form ...

I included that code because it already handles token integration and the variable forms from that patch can be reused here.

bleen’s picture

StatusFileSize
new11.84 KB

the patch in #13 does not apply correctly. Please use this patch instead

bleen’s picture

StatusFileSize
new11.89 KB

...and now without the whitespace. Its weird ... every once in a while I get these hard tabs when I apply a patch and it makes me sad. Anyway...

bleen’s picture

StatusFileSize
new9.31 KB

This is a re-roll of #15 with a bug fix that prevented the "add another variable" button from working in the context reaction form. It includes the latest patch from #1791670: Allow sites to include variables (with token replacement) from the Omniture settings form as much of the code is shared. I would not commit this patch with first committing that one and then re-rolling

bleen’s picture

lucascaro’s picture

This is great!
It applied without problems to the 7.x-1.x. Did not interfere with the token variables I had set.

I've tried adding a global (always active) context with variables and it worked fine.
I've also tried adding custom variables for nodes of type article and checked that they were showing on articles an not on other content types.

The rendering of tokens in variables seemed to be working.

@bleen18 this is indeed a great feature and does add even more awesomer flexibility :)

+++ b/omniture.module
@@ -60,11 +60,49 @@ function omniture_theme($existing, $type, $theme, $path) {
+      $variables = $plugin->execute($variables);
+++ b/plugins/context/omniture_reaction_variables.inc
@@ -0,0 +1,67 @@
+  function execute(&$variables) {

I'm not sure why this is passed by ref and returned as a value here. Maybe this is the "context way". I think it would be clearer if this used either option instead of both at the same time (removing the & from the function signature would be the easiest option since the phpdoc won't need to be updated).

Other than that, I think this is totally RTBC

bleen’s picture

StatusFileSize
new4.17 KB

You are correct ... no reason to have both a return value AND pass-by-ref...

This patch should do it then.

lucascaro’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1001 bytes
new4.28 KB

Attaching a patch as a suggestion. (removes the return and an unnecessary variable and updates the comments, see interdiff).

Marking as RTBC since this is just a minor detail :)

bleen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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