_uc_ajax_cart_load_res() gets called as soon as the uc_ajax_cart.module file is included, which in come cases can occur before bootstrap has finished. This results in an PHP error about drupal_add_* being undefined.

A simple solution is to rename _uc_ajax_cart_load_res to uc_ajax_cart_init(). hook_init() is only ever run once during bootstrap, so that also eliminates the need for the static $loaded variable.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stewart.adam’s picture

Status: Active » Needs review
FileSize
892 bytes

Patch attached, marking as needs review.

stewart.adam’s picture

Status: Needs review » Fixed

This was committed by the previous maintainer.

Status: Fixed » Closed (fixed)

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