Node Access Product Module (nap) - Really embarrassing error message I have built an Ubercart site, using the Node Access Product module, that sells only two products, one of which is access to a single node. Everything works correctly, but after the customer makes a successful purchase the following errors are repeated all the down the completed order page:

"Notice: Trying to get property of non-object in nap_save_purchase() (line 1508 of /home/mysite/public_html/sites/all/modules/nap/nap.module)"

and

"Notice: Undefined index: type in drupal_write_record() (line 7025 of /home/mysite/public_html/includes/common.inc)"

I have been everywhere looking for an answer. Can anyone help?
This error is thrown when an object is empty, and you attempt to determine the value of a property. In this case the following code is responsible:

 // Go through each of the products purchased.
  for ($i = 0; $i &lt; count($product_nodes); $i++) {
    // Easy referencing.
    $node = &amp;$product_nodes[$i];
    $settings = nap_get_nap_settings($node-&gt;nid); &lt;- Throws error


My guess is that $product_nodes is empty.

Try wrapping the for loop as follows:

 // Go through each of the products purchased.
  if (!empty($product_nodes)) {
    for ($i = 0; $i &lt; count($product_nodes); $i++) {
      // Easy referencing.
      $node = &amp;$product_nodes[$i];
      $settings = nap_get_nap_settings($node-&gt;nid);

      ..rest of loop code ...

    } //End of for loop
  }


This should work. You should also bring this up as an issue on the project page.