3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Douglas Musty -
Number of replies: 7

After upgrading to 3.6.3 I am getting this error. Is anyone else experiencing or know how to resolve?

3.6.3+ (Build:20190315)


Exception - Call to a member function get_formatted_name() on null

Debug info:
Error code: generalexceptionmessage
Stack trace:
  • line 2419 of /course/renderer.php: Error thrown
  • line 133 of /index.php: call to core_course_renderer->frontpage()

Average of ratings: -
In reply to Douglas Musty

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Ken Task -
Picture of Particularly helpful Moodlers

Not experienced.   Upgraded from what version to 3.6.3+?

Error about rendering the front page. Line 2419 of /course/renderer.php is related to site news forums in looking at the code.

Was your theme compat with the upgraded version?

Could add a line to config.php to force usage a stock theme that comes with 3.6.3:

$CFG->theme='boost';

To see if it's a theme issue.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Douglas Musty -

Added the theme config setting but the same thing is happening. I clear the themes caches and tried a couple different themes with the same error occurring.


[21-Mar-2019 11:21:50 America] PHP Notice:  Undefined index: forum in /home5/public_html/elearn/course/renderer.php on line 2417
[21-Mar-2019 11:21:50 America] Default exception handler: Exception - Call to a member function get_formatted_name() on null Debug: 
Error code: generalexceptionmessage
* line 2419 of /course/renderer.php: Error thrown
* line 133 of /index.php: call to core_course_renderer->frontpage()

In reply to Douglas Musty

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This seems to be in the code that builds the front page. 

Generally this kind of thing happens when some function returns a 'null' response rather than coming back with some data. Often because of an unexpected error without proper error handling. 

So... in addition to Ken's advice... switch on Debugging and reproduce the error. Check your web server's error log for any warnings or notices that might be the precursor to this fatal error. 

In reply to Howard Miller

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Douglas Musty -

Turned on all debugging. There were three issues related to plugins and a theme. I resolved those but the error is still occurring.

In reply to Douglas Musty

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Ken Task -
Picture of Particularly helpful Moodlers

Sigh!  Missed a question ... 'upgraded from what to what you have now'?

Those 3 plugins ... any of them addons for forums?

Something about system now in order ... can you located the web services error logs?   What do they show?

Are you remotely hosted on shared or a VPS or?

Platform (OS) could also come into play.

Got command line to site?   There are some scripts in moodlecode/admin/cli/ that will help with Database ... character set/collation and at all levels ... DB, Tables, and columns in those tables.  If nothing else will give ya some more info.

What does php mysql_compressed_rows.php -i show?

'spirit of sharing', Ken


In reply to Ken Task

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Douglas Musty -
  • Do not know exact build but from 3.4 to 3.6.3
  • plugins laegrader and groupdocs removed for now. Theme Aigne re-installed.
  • Remote hosted on shared
  • Linux, do not now distribution (Apache 2.4, PHP 7.0, MySQL 5.6, Perl 5.26)

Not where I can right now but I can SSH into the server tonight and run the command.
In reply to Douglas Musty

Re: 3.6.3+ (Build:20190315) Exception - Call to a member function get_formatted_name() on null

by Ken Task -
Picture of Particularly helpful Moodlers

'shared host' ...

2 possible issues - one is theme ...
https://moodle.org/plugins/pluginversions.php?plugin=theme_aigne
shows compat up to version 3.0 of Moodle.

The second possible issue ...
folks who are on shared host may have issues in setting
the 'right' character set/collation and file format (Barricuda) for DB for version 3.6.any
https://docs.moodle.org/36/en/MySQL_full_unicode_support

Running the scripts in moodlecode/admin/cli/ might fail as they require a user that can alter DB server config and no one does that on shared hosting DB servers cept tech support of provider.

'spirit of sharing', Ken