I created a custom view that was used to output a print version of an invoice. The view used the commerce_kickstart_ui module and output the error undefined property: stdClass::$type in commerce_kickstart_product_ui.module line 69 when ever I tried to print the invoice which was output without any Drupal blocks or regions. Only the invoice content was displayed in the browser.

The problematic code was as follows:

/**
   * Override or insert variables into the page template.
*/
function commerce_kickstart_product_ui_preprocess_page(&$vars) {
      $product_display_types = commerce_product_reference_node_types();
          if (!empty($vars['node']) && isset($product_display_types[$vars['node']->type])) {
            $vars['title'] = "";
          }
  }

I amended the code in the module to the following:

/**
   * Override or insert variables into the page template.
*/
function commerce_kickstart_product_ui_preprocess_page(&$vars) {
      $product_display_types = commerce_product_reference_node_types();
      if (isset($vars['node']->type)) {
          if (!empty($vars['node']) && isset($product_display_types[$vars['node']->type])) {
            $vars['title'] = "";
          }
      }
  }

Works in that there are no more error messages displayed when I print the invoice but any comments would be appreciated.

Comments

Status:Active» Fixed
StatusFileSize
new1.18 KB

I don't understand how a node could not have a type, but anyway I committed a slightly different patch.

Status:Fixed» Closed (fixed)

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