PHP notice: Trying to get property of non object

PHP notice: Trying to get property of non object

by Diana Brewster -
Number of replies: 2

I just checked my website error logs, and see something I've never seen before, hundreds of:

PHP Notice: Trying to get property of non-object in [my_path]/lib/blocklib.php on line 429.

This is in

function blocks_find_block($blockid, $blocksarray) {

...

if($instance ->blockid == $blockid)

There have been no code changes to Moodle.

I'm using Moodle 1.9 (2007101509).

What does blocklib do?

Is my php.ini just too verbose in its alerts? Is this something I need not pay attention to? Or should I be looking at something?

thanks!

---Diana

Average of ratings: -
In reply to Diana Brewster

Re: PHP notice: Trying to get property of non object

by Diana Brewster -
update: after some testing, the error looks like it's related to creating a new questionnaire in a new course. I am using the Questionnaire module.

PHP Notice: Trying to get property of non-object in [my_path]/lib/blocklib.php on line 429.

Should I reset blocks with this script?

Resetting the block layout for existing courses

http://docs.moodle.org/en/Block_layout

One thing did change: courses were rearranged into blocks and categories.

Could that cause this problem?
Could a non-categorized course "restored" into a category cause it?

thanks! (I do hate seeing errors! smile )

---Diana

In reply to Diana Brewster

Re: PHP notice: Trying to get property of non object

by Diana Brewster -
I'm not fully convinced this has to do with the Questionnaire module. I've been trying various activities and immediately checking website error logs, and still can't predict what causes the error.

I'm just looking for some guidance: what does blocklib.php do, what does this function do, and how can I (safely) debug it?

---Diana