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

tr’s picture

Version: 7.x-3.2 » 7.x-3.x-dev
Priority: Normal » Minor

If 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.

longwave’s picture

Status: Active » Fixed

Fix committed.

Status: Fixed » Closed (fixed)

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