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
Comment #1
danielb commentedI guess it doesn't test whether those properties exist before trying to determine their value. Instead of
if ($blah)it should doif (!empty($blah)).Comment #2
danielb commentedCommitted a fix, will appear in next dev snapshot. Cheers.