I'm trying to set up a store using nap, and running into lots of errors when I try to create any product nodes. Here are the errors that appear:

Notice: Undefined property: stdClass::$nap_categories in nap_node_presave() (line 760 of /[site]/sites/all/modules/nap/nap.module).
Notice: Undefined property: stdClass::$nap_view in nap_node_presave() (line 761 of /[site]/sites/all/modules/nap/nap.module).
Notice: Undefined property: stdClass::$nap_view_args in nap_node_presave() (line 762 of /[site]/sites/all/modules/nap/nap.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nid' cannot be null: INSERT INTO {nap_products} (nid, vid, entry_date, categories, nodes, view, view_args) VALUES (:nid, :vid, NOW(), :categories, :nodes, :view, :view_args); Array ( [:nid] => [:vid] => [:categories] => N; [:nodes] => a:0:{} [:view] => [:view_args] => ) in nap_save() (line 989 of /[site]/sites/all/modules/nap/nap.module).

The error occurs whether or not I choose a specific node to grant access to. Any ideas how to resolve? Thanks in advance for any help!

Comments

danielb’s picture

I guess it doesn't test whether those properties exist before trying to determine their value. Instead of if ($blah) it should do if (!empty($blah)).

danielb’s picture

Status: Active » Fixed

Committed a fix, will appear in next dev snapshot. Cheers.

Status: Fixed » Closed (fixed)

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