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

Invalid input syntax caused by repeated tag elements on restore (quiz, lesson)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Backup, Quiz
    • Labels:
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      It looks like this error only occurs when you try to restore a course with quizzes and a quiz has no attempts. An invalid input syntax is returned with the full error looking like:

      ERROR: invalid input syntax for integer: "
      "
      INSERT INTO mdl_quiz
      (name,intro,introformat,timeopen,timeclose,optionflags,penaltyscheme,attempts,attemptonlast,grademethod,decimalpoints,questiondecimalpoints,review,questionsperpage,shufflequestions,shuffleanswers,questions,sumgrades,grade,timecreated,timemodified,timelimit,password,subnet,popup,delay1,delay2,showuserpicture,showblocks,course)
      VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30)
      RETURNING id
      [array (
      'name' => 'arrays',
      'intro' => '',
      'introformat' => '1',
      'timeopen' => 1292338151,
      'timeclose' => '0',
      'optionflags' => '0',
      'penaltyscheme' => '0',
      'attempts' => '
      ',
      'attemptonlast' => '0',
      'grademethod' => '3',
      'decimalpoints' => '2',
      'questiondecimalpoints' => '2',
      'review' => '71760879',
      'questionsperpage' => '0',
      'shufflequestions' => '0',
      'shuffleanswers' => '0',
      'questions' => '',
      'sumgrades' => '0.00000',
      'grade' => '0.00000',
      'timecreated' => 1295837491,
      'timemodified' => 1295837491,
      'timelimit' => '3600',
      'password' => '',
      'subnet' => '',
      'popup' => '1',
      'delay1' => '0',
      'delay2' => '0',
      'showuserpicture' => '0',
      'showblocks' => '0',
      'course' => 48,
      )]

      You can see where the 'attempts' elements is, it seems to contain a new line escape character which breaks the input rule of it only allowing an integer.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    21/Feb/11