This issue is in follow up to a IRC conversation between me and Berdir. Basically, if you create a new node using the "Create an entity" action and the content type is using Userpoints Node Access functionality, then the following error message is displayed:

Notice: Undefined property: stdClass::$userpoints_nodeaccess_points_price in userpoints_nodeaccess_update_node() (line 208 of /Users/benkaplan/git/drupal/sites/all/modules/userpoints_nodeaccess/userpoints_nodeaccess.module).

So apparently, Userpoints Node Access doesn't like nodes created by Rules.

According to Berdir, the problem is most probably that rules does not call the prepare hook for new nodes. UP-NA uses that to define a default value for that property. Maybe rules should do that, but we should add a check in UP-NA anyway (since it doesn't cost much to do it).

--Ben

CommentFileSizeAuthor
#1 fix_notice.patch1.21 KBberdir

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

This should fix the error.

BenK’s picture

Status: Needs review » Reviewed & tested by the community

Tested the patch and everything is working great. Not only is notice gone, but now a node created with Rules will inherit the number of points to access the content from the default content type settings. This is RTBC.

Thanks!

--Ben

BenK’s picture

Have you had a chance to commit this yet? :-)

--Ben

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Finally commited, sorry about the delay ;)

Status: Fixed » Closed (fixed)

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