Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2013 at 14:44 UTC
Updated:
24 Oct 2013 at 18:00 UTC
Notice: Undefined variable: _SESSION in uc_googleanalytics_page_alter() (line 44 of /home/passingb/public_html/sites/all/modules/ubercart/uc_googleanalytics/uc_googleanalytics.module).
This error appears on a url that is listed as the custom completion URL for checkout when that page is visited without going through a checkout.
This error is caused by this line 44 @ uc_googleanalytics.module:
unset($_SESSION['ucga_order_id']);
Modifying this line to the following resolves the issue:
if(isset($_SESSION['ucga_order_id'])) unset($_SESSION['ucga_order_id']);
I do not want to upgrade to the latest version to be able to submit a patch, but it should be a simple change in the next updated version.
Comments
Comment #1
tr commentedIf anonymous users can visit your checkout complete page directly, you have bigger problems - namely, your analytics data will be wrong. So yeah, we can probably suppress the PHP notice (PHP notices are always *minor* problems), but I don't see that this is a real problem: Unless you've published that URL, the only way it's reachable should be by completing the checkout process.
Comment #2
longwaveFix committed.