I got a lot of

Notice: Undefined variable: product in jirafe_page_alter() (line 128 of jirafe.module)

in the watchdog...

if ($product) {
  ...
}

Should be replaced by :

if (isset($product)) {
}

Generally speaking, this page_alter doesn't seem to be properly written, especially the part above :


      $product_references = field_read_fields(array('type' => 'commerce_product_reference'));
      foreach ($product_references as $product_reference) {
        if (!empty($node->{$product_reference['field_name']})) {
          $product = commerce_product_load($node->{$product_reference['field_name']}[LANGUAGE_NONE][0]['product_id']); // Why are we loading the first attached product ? And why don't we use the entity_metadata_wrapper here ?
        }
      }

Comments

jsacksick’s picture

Title: Notice: Undefined variable: product in jirafe_page_alter() (line 128 of jirafe.module) » Cleanup the hook_page_alter() implementation.
jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB
haza’s picture

Status: Needs review » Fixed

Thanks ! Commited !

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Typo correction