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

Wrong usage of continue in get_user_profile_fields()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.8, 2.9.2, 3.0
    • Fix Version/s: 2.8.9, 2.9.3
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Make sure you don't have any custom profile fields defined
      2. View/edit user profile, there should not be any errors
      3. Create custom profile field(s)
      4. View/edit user profile, make sure custom profile fields appear
      Show
      Make sure you don't have any custom profile fields defined View/edit user profile, there should not be any errors Create custom profile field(s) View/edit user profile, make sure custom profile fields appear
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull Master Branch:
      wip-MDL-51999-master

      Description

      One of the continue statements is used in get_user_profile_fields() function in grade/lib.php outside of a loop:

                  if (!is_array($customfields)) {
                      continue;
                  }
      

      In PHP 7 this will cause fatal error:
      Fatal error: 'continue' not in the 'loop' or 'switch' context in grade/lib.php on line 3147 (https://github.com/moodle/moodle/blob/master/grade/lib.php#L3146).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/15