Moodle
  1. Moodle
  2. MDL-31554

Undefined variable: infomessages in mod\quiz\view.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      Windows 7
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      0. With developer debug mode set.
      1. Log in as guest.
      2. Go to the info page for a quiz and make sure that you see the "Guests can't do quizzes" messages and not notices.
      3. Make a role none of mod/quiz:attempt, mod/quiz:reviewmyattempts or mod/quiz:preview but does have mod/quiz:view. Assign a user that role in a course with quizzes, and visit the quiz.
      4. Verify you see a different message, again with no notices.
      4. Lot in as that user

      Show
      0. With developer debug mode set. 1. Log in as guest. 2. Go to the info page for a quiz and make sure that you see the "Guests can't do quizzes" messages and not notices. 3. Make a role none of mod/quiz:attempt, mod/quiz:reviewmyattempts or mod/quiz:preview but does have mod/quiz:view. Assign a user that role in a course with quizzes, and visit the quiz. 4. Verify you see a different message, again with no notices. 4. Lot in as that user
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      I get this notice and warning when a guest user tries to attempt a quiz :
      Notice: Undefined variable: infomessages in ...\mod\quiz\view.php on line 226
      Warning: Invalid argument supplied for foreach() in ...\mod\quiz\renderer.php on line 517

      The rest of the page (quiz description, message for guests and connexion button) display normally.
      Don't know if this bug has consequences.

        Gliffy Diagrams

          Activity

          Hide
          Tim Hunt added a comment -

          Thanks for spotting this.

          Show
          Tim Hunt added a comment - Thanks for spotting this.
          Hide
          f p added a comment -

          Thanks for solving this so quickly

          Show
          f p added a comment - Thanks for solving this so quickly
          Hide
          Sam Hemelryk added a comment -

          Thanks Tim, changes look spot on and have been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Tim, changes look spot on and have been integrated now
          Hide
          Glenn Ansley added a comment -

          Confirmed bug for guest user and special role in current master and current 2.2 stable.

          Also confirmed valid fix in master and 2.2 branches of integrations.

          Looks good.

          Show
          Glenn Ansley added a comment - Confirmed bug for guest user and special role in current master and current 2.2 stable. Also confirmed valid fix in master and 2.2 branches of integrations. Looks good.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks!

          Closing as fixed, heading to zzzZZZzzz, niao

          Show
          Eloy Lafuente (stronk7) added a comment - It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks! Closing as fixed, heading to zzzZZZzzz, niao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: