I get multiple notices of the type
Notice: Trying to get property of non-object in aup_preprocess() line 38 of /home/hameer3/public_html/sites/all/modules/aup/aup.module).
In most pages related to the Answer module in general.

Comments

hameerabbasi’s picture

Title: Get multiple notices » Declare dependency of AUP module on Rules UI module

The message went away after enabling Rules UI.

chipcleary’s picture

Thanks for submitting this.

A quick update. I validated on a fresh install that I get the same notices. However, enabling Rules UI does not eliminate them for me.

I will investigate further.

chipcleary’s picture

Status: Needs work » Needs review

OK. This should now be fixed.

How to fix an existing site

You do not need to change the code in the module.

Run this code in a php window:

module_install_include('aup');
aup_install();

Note: Even if you install the new dev version mentioned below, you will need to make sure that aup_install is run. You can do this by using the above code or the "Reinstall Module" function of the devel module. This is because hook_install functions are not run automatically when you simply disable/re-enable a module using the module UI.

How to avoid the problem in a new site

Please use the new 7.x-1.x-dev version.

What is happening?

For the curious ....

AUP relies on UserPoints. UserPoints employs its own vocabulary and a set of vocabulary terms to track points. It allows others to create their own terms if they want to track their specific categories of points. AUP employs such a custom term.

AUP previously assumed that UserPoints created its vocabulary on installation. This is wrong, the vocabulary is only created on demand. Because of this, AUP was failing to create its term. That led to the error message seen.

The fix was simply to trigger UserPoints to create its vocabulary before AUP creates its term.

hameerabbasi’s picture

I'm really sorry I cannot test this, as the problem is already fixed on my site.

hameerabbasi’s picture

Status: Needs review » Reviewed & tested by the community

Tested on fresh install. Fixed.

chipcleary’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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