"Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

"Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -
Number of replies: 9
Hi All, 


We recently upgraded to Moodle Version 3.1.6 from 2.1.x, and we now have a Coding Error: "Invalid property requested, or the property does not has(sic) a default value." I cannot access any course, or any part of Site Administration. I can access the server and the database on the back end. 

I get the following lines after I turn on debugging in config.php:

  • Notice: Undefined property: stdClass::$defaultpreference_mailformat in /home/moodlesc/public_html/lib/classes/user.php on line 355
  • Notice: Undefined property: stdClass::$defaultpreference_maildigest in /home/moodlesc/public_html/lib/classes/user.php on line 357
  • Notice: Undefined property: stdClass::$defaultpreference_maildisplay in /home/moodlesc/public_html/lib/classes/user.php on line 359
  • Notice: Undefined property: stdClass::$defaultpreference_autosubscribe in /home/moodlesc/public_html/lib/classes/user.php on line 361
  • Notice: Undefined property: stdClass::$defaultpreference_trackforums in /home/moodlesc/public_html/lib/classes/user.php on line 363

I followed the suggestions here, and added the five lines to mdl_config, but I am still getting the error.  

Any suggestions?






Average of ratings: -
In reply to Christopher Sweets

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

How did you upgrade?  Normally you need to go to 2.2 and then 2.7 before jumping to 3.1 or later...

In reply to Emma Richardson

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -

We did do interval upgrades to 2.7, and then jumped to 3.1.6.  We logged into the site after each, and did not find the issue until after the last upgrade we did.   

In reply to Christopher Sweets

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Those lines don't go in Moodle config - they added the values to the database...that is an mysql command...you need to add those lines to the mdl_config table with the default values added.  

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -

When I turn on debugging from config.php, I get the errors mentioned above.  I followed the directions in the linked article, which suggested adding five additional records into the table mdl_config, which I have done, but I still receive the errors listed in my original post.



In reply to Christopher Sweets

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Can you show us a screenshot of the table in question with the entries?  Have you tried restarting mysql and apache?  Maybe clear caches...

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -

Here is the screenshot of the entries.  I tried both the settings they suggested in the linked article, and 0's as the defaults.


I cannot get to the purge caches setting on Moodle.  I am working on an unfamilar system type, but I will see about restarting appache and MySQL.

Attachment mdl_config.png
In reply to Emma Richardson

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -

Restarting Apache and MySQL did not help.

Attachment 2017-06-01_1317.png
In reply to Christopher Sweets

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Go into your moodleDATA folder (not your moodle code folder) and delete both the cache and localcache folders and see if that helps anything.

It should be working...did you get through the upgrade and the errors are now showing up at the site?  I wonder if the upgrade needs to run again - is there by chance a newer version that you could try downloading to set the upgrade off again?

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: "Notice: Undefined Property" after upgrade to 3.1.6 (Site Down)

by Christopher Sweets -

That did it!  Thank you.  I needed to delete the cache folders.


I work with Bb, Canvas, and Sakai for a living, and was helping out a NFP I know with their Moodle install.  Thank you so much for your help!