MDL-32379 several user profile fields were unset during forum message processing, in an effort to reduce memory usage. However forums include the ability to restrict access based on user profile fields, and if a forum is restricted by one of the unset fields the forum cron fails. This halts the forum cron and prevents any remaining forum digests from being sent.
Exception during cron: Coding error detected, it must be fixed by a programmer: Requested user profile field does not exist Debug:
Error code: codingerror
- line 1383 of /lib/conditionlib.php: coding_exception thrown
- line 1065 of /lib/conditionlib.php: call to condition_info_base->get_cached_user_profile_field()
- line 1152 of /lib/modinfolib.php: call to condition_info_base->is_available()
- line 336 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()
- line 1396 of /lib/modinfolib.php: call to course_modinfo->__construct()
- line 54 of /filter/activitynames/filter.php: call to get_fast_modinfo()
- line 167 of /lib/filterlib.php: call to filter_activitynames->filter()
- line 205 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
- line 1143 of /lib/weblib.php: call to filter_manager->filter_text()
- line 3119 of /mod/forum/lib.php: call to format_text()
- line 1029 of /mod/forum/lib.php: call to forum_make_mail_post()
- line 311 of /lib/cronlib.php: call to forum_cron()
- line 62 of /admin/cli/cron.php: call to cron_run()
Steps To Replicate:
1. Create a forum, and restrict access based on a user field that is unset (i.e. Institution). See screenshot.
2. Change Subscription Mode to Forced Subscription.
3. Enrol a student in the course and set their preference to receive digests.
4. Monitor the cron for the failure.