Closed (fixed)
Project:
Optimizely
Version:
7.x-2.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Jul 2013 at 16:05 UTC
Updated:
12 Aug 2013 at 23:51 UTC
Jump to comment: Most recent file
If you make 2 paths in one project, and then exclude them, the snippet continues to appear in the source code of the 2 paths.
Comments
Comment #1
plehrer commentedThe snippet is properly excluded from the project's paths, and appear only in paths except those listed in the project.
Comment #2
DeeZone commentedCan you please describe the issue in further detail. My understanding is that it's currently possible to enable project entries that end up pointing to the same path by using the exclude path setting. When this happens, more that one javascript call ends up being generate on the common path. Is this correct? If so,please update your issue summary.
Can you re-roll your patch using the break; in hook_init solution we discussed today?
Comment #3
DeeZone commentedComment #4
plehrer commentedLet's say that you have an about us page with the alias "about," and a contact form with alias "contact," and the current code:
$project_path is the current path of the page being loaded. $target_path is the path in our Optimizely project.
Now, in this example, you have an Optimizely project that you want the module to insert the snippet on all pages other than "about" and "contact."
So when the path of the page currently being loaded ($project_path) is "about," then the snippet will appear on that page when the $target_path equals "contact"; and when the page being loaded is "contact", then the snippet will appear on that page when the $target_path equals "about." If this doesn't make sense to you, remember you are looping through the paths in Optimizely project.
If you had just one path in the project this would not be an issue. However, when you have 2 (or more), a snippet will always appear on an excluded path. In fact, it will appear on every page of your website.
I hope this makes sense.
Also, I do use the break command in my patch.
Comment #5
DeeZone commentedThanks for the details, I've found a working solution that address the issue you've identified as well as a few other scenarios. 7.x-2.11 will resolve this item.
Comment #6
plehrer commentedI wrote a solution and fine tuned my previous one. It takes out most of the redundant code.
Comment #7
plehrer commentedI updated the patch to make hook_init to make include paths and excludes paths work. I also works with paths that don't have an alias as well as wildcards. This patch works with all my tests. This patch was made against the version "7.x-2.x_Bug-Fixes" from the Version Control page.
Comment #8
plehrer commentedI created another patch to change the comments of hook_init.
I changed:
* For example, '<front>' will add the Optimizely snippet on the front page, and
* 'clubs/*' will place the snippet on all pages bellow 'clubs/'. Note: The javascript
* call / snippet will only appear on the actual 'clubs' page if you specify 'clubs'
* without the wildcard.
to
* For example, '<front>' will add the Optimizely snippet on the front page, and
* 'clubs/*' will place the snippet on 'clubs' and all pages bellow 'clubs/'.
This patch was made against the version "7.x-2.x_Bug-Fixes" from the Version Control page.
Comment #9
DeeZone commentedThis patch was not used as the exclude functionality was removed from project entries in 7.x-2.11.