Affects Version/s: 2.0.2
Fix Version/s: 2.0.4
Pull from Repository:
Pull Master Branch:wip-
Pull Master Diff URL:
If you create a new user profile field that is a menu type (drop-down select menu) then calendar exporting starts throwing an error message.
This is because calendar/export_execute.php uses the get_complete_user_data function; which is getting the information for any user profile fields configured in the installation.
Within the 'menu' user profile field there is a call to format_string() - format_string errors when called without a valid page context.
Coding problem: this page does not set $PAGE->context properly.
line 341 of /lib/pagelib.php: call to debugging()
line 599 of /lib/pagelib.php: call to moodle_page->magic_get_context()
line 1236 of /lib/weblib.php: call to moodle_page->__get()
line 23 of /user/profile/field/menu/field.class.php: call to format_string()
line 496 of /user/profile/lib.php: call to profile_field_menu->profile_field_menu()
line 517 of /user/profile/lib.php: call to profile_user_record()
line 3820 of /lib/moodlelib.php: call to profile_load_custom_fields()
line 16 of /calendar/export_execute.php: call to get_complete_user_data()
Does calendar need to use get_complete_user_data function?
A get_record call to user table might suffice instead and would stop this error.
I haven't seen any evidence of this issue occurring elsewhere where get_complete_user_data() is called (e.g. rss/file.php); but of course, there may be other areas affected.