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

Wrong usage of continue in get_user_profile_fields()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.8, 2.9.2, 3.0
    • 2.8.9, 2.9.3
    • Gradebook
    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • wip-MDL-51999-master
    • 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

    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

            marina Marina Glancy
            tmuras Tomasz Muras
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            John Okely John Okely
            Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9/Nov/15