Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46977

mod_forum: Requested user profile field does not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.5, 2.5.6, 2.5.7, 2.7, 2.8
    • Fix Version/s: BACKEND
    • Component/s: Forum
    • Labels:
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE

      Description

      In 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jmarshall Josh Marshall
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: