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

Course Content Duplicate error when grade letters changed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.1, 2.2, 2.3, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Course
    • Labels:
    • Environment:
      RH Linux 6
    • Database:
      MySQL
    • Testing Instructions:
      Hide
      1. Logged as a teacher go to a course with students
      2. Course administration -> Gradebook -> Letters edit on the dropdown menu -> check "override site defaults" and save changes
      3. Backup the course with the default backup values
      4. Restore the backup selecting "Restore into this course" and "Merge the backup course into this course" in the 2nd step
      5. You SHOULD be able to restore the backup without exceptions
      6. Restore the backup in a new course
      7. You SHOULD be able to restore the backup without exceptions and if you go to the new course gradebook -> edit letters, you can see the "Override site defaults" option checked
      Show
      Logged as a teacher go to a course with students Course administration -> Gradebook -> Letters edit on the dropdown menu -> check "override site defaults" and save changes Backup the course with the default backup values Restore the backup selecting "Restore into this course" and "Merge the backup course into this course" in the 2nd step You SHOULD be able to restore the backup without exceptions Restore the backup in a new course You SHOULD be able to restore the backup without exceptions and if you go to the new course gradebook -> edit letters, you can see the "Override site defaults" option checked
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-29598_master

      Description

      I am using Moodle 2.1.1 on RH6 with mysql.

      Whenever the default grade letters for a course are changed and I duplicate any course content I get "Error writing to database".

      In the log it shows:

      Duplicate entry '209685-0.00000-F' for key 'mdl_gradlett_conlowlet_uix'
      INSERT INTO mdl_grade_letters (lowerboundary,letter,contextid) VALUES(?,?,?)
      [array (
        0 => '0.00000',
        1 => 'F',
        2 => '209685',
      )]

      What can I do to correct this problem?. Is there a patch available ?

      Thanks, Jose

        Gliffy Diagrams

          Issue Links

            Activity

            jose@fiu.edu Jose Prendes created issue -
            Hide
            salvetore Michael de Raadt added a comment -

            Hi, Jose.

            Thanks for reporting that. I couldn't find a report of this already in Tracker.

            Perhaps the grade value duplication is not necessary.

            Feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

            Show
            salvetore Michael de Raadt added a comment - Hi, Jose. Thanks for reporting that. I couldn't find a report of this already in Tracker. Perhaps the grade value duplication is not necessary. Feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
            salvetore Michael de Raadt made changes -
            Field Original Value New Value
            Fix Version/s STABLE backlog [ 10463 ]
            Description I am using Moodle 2.1.1 on RH6 with mysql.

            Whenever the default grade letters for a course are changed and I duplicate any course content I get "Error writing to database".

            In the log it shows:

            Duplicate entry '209685-0.00000-F' for key 'mdl_gradlett_conlowlet_uix'
            INSERT INTO mdl_grade_letters (lowerboundary,letter,contextid) VALUES(?,?,?)
            [array (
              0 => '0.00000',
              1 => 'F',
              2 => '209685',
            )]
            What can I do to correct this problem?. Is there a patch available ?

            Thanks, Jose
            I am using Moodle 2.1.1 on RH6 with mysql.

            Whenever the default grade letters for a course are changed and I duplicate any course content I get "Error writing to database".

            In the log it shows:

            {noformat}Duplicate entry '209685-0.00000-F' for key 'mdl_gradlett_conlowlet_uix'
            INSERT INTO mdl_grade_letters (lowerboundary,letter,contextid) VALUES(?,?,?)
            [array (
              0 => '0.00000',
              1 => 'F',
              2 => '209685',
            )]{noformat}

            What can I do to correct this problem?. Is there a patch available ?

            Thanks, Jose
            Labels triaged
            Assignee moodle.com [ moodle.com ] Andrew Davis [ andyjdavis ]
            Hide
            rjscott2005 Rob Scott added a comment - - edited

            Hi-
            I haven't duplicated any courses however when I try to change the default letters using Settings>Site administration>Grades>Letters, I get a similar error. I don't know if stack trace info is necessary so I've added that as well. Moodle 2.2

            Debug info: Duplicate entry '1-80.00000-B-' for key 'mdl_gradlett_conlowlet_uix'
            UPDATE mdl_grade_letters SET letter = ?,lowerboundary = ?,contextid = ? WHERE id=?
            [array (
            0 => 'B-',
            1 => 80,
            2 => '1',
            3 => 1,
            )]

            Stack trace:

            line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
            line 985 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
            line 1017 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
            line 168 of /grade/edit/letter/index.php: call to mysqli_native_moodle_database->update_record()

            Show
            rjscott2005 Rob Scott added a comment - - edited Hi- I haven't duplicated any courses however when I try to change the default letters using Settings>Site administration>Grades>Letters, I get a similar error. I don't know if stack trace info is necessary so I've added that as well. Moodle 2.2 Debug info: Duplicate entry '1-80.00000-B-' for key 'mdl_gradlett_conlowlet_uix' UPDATE mdl_grade_letters SET letter = ?,lowerboundary = ?,contextid = ? WHERE id=? [array ( 0 => 'B-', 1 => 80, 2 => '1', 3 => 1, )] Stack trace: line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown line 985 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1017 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw() line 168 of /grade/edit/letter/index.php: call to mysqli_native_moodle_database->update_record()
            Hide
            rjscott2005 Rob Scott added a comment - - edited

            Please disregard this comment.

            Show
            rjscott2005 Rob Scott added a comment - - edited Please disregard this comment.
            Hide
            mwojcik Mateusz Wójcik added a comment -

            The same problem also occurs in version 2.0 during restore the course into the same course with merging data option.
            Instructions:
            1. Create course with some content.
            2. Go Course Administration, Grades, Settings, Letters, Edit Grade Letters & change any of them.
            3. Backup course.
            4. Restore the course into the same course with merging data option.

            Show
            mwojcik Mateusz Wójcik added a comment - The same problem also occurs in version 2.0 during restore the course into the same course with merging data option. Instructions: 1. Create course with some content. 2. Go Course Administration, Grades, Settings, Letters, Edit Grade Letters & change any of them. 3. Backup course. 4. Restore the course into the same course with merging data option.
            jfilip Justin Filip made changes -
            Link This issue has been marked as being related by MDL-30515 [ MDL-30515 ]
            Hide
            jfilip Justin Filip added a comment - - edited

            We've seen some upgrades from Moodle 1.9 to Moodle 2.0 and 2.1 fail because the mdl_grade_letters table has duplicate values in it. This problem doesn't seem to be just limited to Moodle 2.x.

            See MDL-30515 for more info on the upgrade problems.

            Show
            jfilip Justin Filip added a comment - - edited We've seen some upgrades from Moodle 1.9 to Moodle 2.0 and 2.1 fail because the mdl_grade_letters table has duplicate values in it. This problem doesn't seem to be just limited to Moodle 2.x. See MDL-30515 for more info on the upgrade problems.
            Hide
            jfilip Justin Filip added a comment -

            I can duplicate this problem as well myself. This only happens when the activity being duplicated has user grades associated with it. I tried this with an assignment that had no submissions and the problem didn't occur. When I added a grade value for a single user to the assignment, the error happened duplicate the activity.

            Show
            jfilip Justin Filip added a comment - I can duplicate this problem as well myself. This only happens when the activity being duplicated has user grades associated with it. I tried this with an assignment that had no submissions and the problem didn't occur. When I added a grade value for a single user to the assignment, the error happened duplicate the activity.
            Hide
            jfilip Justin Filip added a comment -

            Here is a more detail debugging message for the problem:

            • Debug info: Duplicate entry '57-0.00000-NC' for key 'mdl_gradlett_conlowlet_uix'
              INSERT INTO mdl_grade_letters (lowerboundary,letter,contextid) VALUES(?,?,?)
              [array (
              0 => '0.00000',
              1 => 'NC',
              2 => '57',
              )]
              Stack trace:
              line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
              line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
              line 935 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
              line 268 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record()
              line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_gradebook_structure_step->process_grade_letter()
              line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
              line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
              line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
              line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
              line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
              line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
              line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
              line ? of unknownfile: call to progressive_parser->end_tag()
              line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
              line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
              line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
              line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
              line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
              line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
              line 302 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
              line 90 of /course/modduplicate.php: call to restore_controller->execute_plan()

            Show
            jfilip Justin Filip added a comment - Here is a more detail debugging message for the problem: Debug info: Duplicate entry '57-0.00000-NC' for key 'mdl_gradlett_conlowlet_uix' INSERT INTO mdl_grade_letters (lowerboundary,letter,contextid) VALUES(?,?,?) [array ( 0 => '0.00000', 1 => 'NC', 2 => '57', )] Stack trace: line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 935 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 268 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record() line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_gradebook_structure_step->process_grade_letter() line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process() line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk() line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk() line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk() line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk() line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk() line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish() line ? of unknownfile: call to progressive_parser->end_tag() line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse() line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse() line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process() line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute() line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute() line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute() line 302 of /backup/controller/restore_controller.class.php: call to restore_plan->execute() line 90 of /course/modduplicate.php: call to restore_controller->execute_plan()
            Hide
            jfilip Justin Filip added a comment -

            I just came up with a patch to fix this problem and it's available in my Github account:

            I'm not sure if there is a place higher up in the restore process that this needs to be fixed but the patch I have is the most obvious solution to the problem.

            Show
            jfilip Justin Filip added a comment - I just came up with a patch to fix this problem and it's available in my Github account: https://github.com/jfilip/moodle/compare/MOODLE_21_STABLE...MDL-29598_m21 https://github.com/jfilip/moodle/tree/MDL-29598_m21 I'm not sure if there is a place higher up in the restore process that this needs to be fixed but the patch I have is the most obvious solution to the problem.
            Hide
            pjfish06 Susan Mangan added a comment - - edited

            We're running 2.2.2 and have reproduced this error. I can't believe we haven't come across it sooner. I guess not many have used the duplicate feature yet.

            Shouldn't this be marked critical?

            I received the following error after completing Step 2:

            Debug info: Duplicate entry '85-83.00000-B' for key 'mdl_gradlett_conlowlet_uix'
            UPDATE mdl_grade_letters SET letter = ?,lowerboundary = ?,contextid = ? WHERE id=?
            [array (
            0 => 'B',
            1 => 83,
            2 => '85',
            3 => 573,
            )]
            Stack trace:

            line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
            line 999 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
            line 1031 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
            line 168 of /grade/edit/letter/index.php: call to mysqli_native_moodle_database->update_record()

            Show
            pjfish06 Susan Mangan added a comment - - edited We're running 2.2.2 and have reproduced this error. I can't believe we haven't come across it sooner. I guess not many have used the duplicate feature yet. Shouldn't this be marked critical? I received the following error after completing Step 2: Debug info: Duplicate entry '85-83.00000-B' for key 'mdl_gradlett_conlowlet_uix' UPDATE mdl_grade_letters SET letter = ?,lowerboundary = ?,contextid = ? WHERE id=? [array ( 0 => 'B', 1 => 83, 2 => '85', 3 => 573, )] Stack trace: line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown line 999 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1031 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw() line 168 of /grade/edit/letter/index.php: call to mysqli_native_moodle_database->update_record()
            Hide
            dmonllao David Monllaó added a comment -

            Thanks for the report and patch Jose and Justin. I assigned it to myself to continue the work of http://tracker.moodle.org/browse/MDL-30515 in the next sprint

            Show
            dmonllao David Monllaó added a comment - Thanks for the report and patch Jose and Justin. I assigned it to myself to continue the work of http://tracker.moodle.org/browse/MDL-30515 in the next sprint
            dmonllao David Monllaó made changes -
            Fix Version/s STABLE Sprint 23 [ 12358 ]
            Fix Version/s STABLE backlog [ 10463 ]
            Assignee Andrew Davis [ andyjdavis ] David Monllaó [ davmon ]
            moodle.com moodle.com made changes -
            Priority Minor [ 4 ] Critical [ 2 ]
            dmonllao David Monllaó made changes -
            Status Open [ 1 ] Development in progress [ 3 ]
            dmonllao David Monllaó made changes -
            Testing Instructions 1. Go Site administration, Courses, Add/edit course, click a course, under Course Content, click 2x button to duplicate content. - works fine
            2. Go Course Administration, Grades, Settings, Letters, Edit Grade Letters & change any of them.
            3. Repeat step 1 again for this course and you will get Error writing to database.
            # Logged as a teacher go to a course with students
            # Course administration -> Gradebook -> Letters edit on the dropdown menu -> check "override site defaults" and save changes
            # Backup the course
            # Restore the backup selecting "Restore into this course" and "Merge the backup course into this course" in the 2nd step
            # You SHOULD be able to restore the backup without exceptions
            # Restore the backup in a new course
            # You SHOULD be able to restore the backup without exceptions and if you go to the new course gradebook -> edit letters, you can see the "Override site defaults" option checked
            dmonllao David Monllaó made changes -
            Pull Master Diff URL https://github.com/dmonllao/moodle/compare/master...MDL-29598_master
            Pull Master Branch MDL-29598_master
            Pull 2.3 Diff URL https://github.com/dmonllao/moodle/compare/MOODLE_23_STABLE...MDL-29598_23
            Testing Instructions # Logged as a teacher go to a course with students
            # Course administration -> Gradebook -> Letters edit on the dropdown menu -> check "override site defaults" and save changes
            # Backup the course
            # Restore the backup selecting "Restore into this course" and "Merge the backup course into this course" in the 2nd step
            # You SHOULD be able to restore the backup without exceptions
            # Restore the backup in a new course
            # You SHOULD be able to restore the backup without exceptions and if you go to the new course gradebook -> edit letters, you can see the "Override site defaults" option checked
            # Logged as a teacher go to a course with students
            # Course administration -> Gradebook -> Letters edit on the dropdown menu -> check "override site defaults" and save changes
            # Backup the course with the default backup values
            # Restore the backup selecting "Restore into this course" and "Merge the backup course into this course" in the 2nd step
            # You SHOULD be able to restore the backup without exceptions
            # Restore the backup in a new course
            # You SHOULD be able to restore the backup without exceptions and if you go to the new course gradebook -> edit letters, you can see the "Override site defaults" option checked
            Pull 2.2 Diff URL https://github.com/dmonllao/moodle/compare/MOODLE_22_STABLE...MDL-29598_22
            Pull 2.2 Branch MDL-29598_22
            Pull from Repository git://github.com/dmonllao/moodle.git
            Affects Version/s 2.3 [ 10657 ]
            Affects Version/s 2.2 [ 10656 ]
            Affects Version/s 2.4 [ 12255 ]
            Pull 2.3 Branch MDL-29598_23
            Hide
            dmonllao David Monllaó added a comment -

            I've replicated the problem restoring a course backup with the "Restore into this course" and "Merge the backup course into this course" options, this patch should also get rid of the duplicate problem, which I failed to reproduce. Submitting for peer review.

            Show
            dmonllao David Monllaó added a comment - I've replicated the problem restoring a course backup with the "Restore into this course" and "Merge the backup course into this course" options, this patch should also get rid of the duplicate problem, which I failed to reproduce. Submitting for peer review.
            dmonllao David Monllaó made changes -
            Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
            fred Frédéric Massart made changes -
            Original Estimate 0 minutes [ 0 ]
            Remaining Estimate 0 minutes [ 0 ]
            Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
            Peer reviewer fred
            Hide
            fred Frédéric Massart added a comment -

            Thanks Jose, David. The patch looks good to me. Push whenever ready!

            Show
            fred Frédéric Massart added a comment - Thanks Jose, David. The patch looks good to me. Push whenever ready!
            fred Frédéric Massart made changes -
            Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
            dmonllao David Monllaó made changes -
            Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            dmonllao David Monllaó added a comment -

            HI Eloy, rebased

            Show
            dmonllao David Monllaó added a comment - HI Eloy, rebased
            nebgor Aparup Banerjee made changes -
            Currently in integration Yes [ 10041 ]
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
            Integrator stronk7
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks! (22, 23 & master)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (22, 23 & master)
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
            Fix Version/s 2.2.5 [ 12352 ]
            Fix Version/s 2.3.2 [ 12353 ]
            timb Tim Barker made changes -
            Tester ankit_frenz
            Hide
            pjfish06 Susan Mangan added a comment -

            We are running 2.3.1 (12.07.26) and are not in a position to run a full upgrade right now but would really like to implement this particular fix as it's causing major issues with our current course content. Is this something we could patch independently of running a full upgrade? Thanks in advance!!

            Show
            pjfish06 Susan Mangan added a comment - We are running 2.3.1 (12.07.26) and are not in a position to run a full upgrade right now but would really like to implement this particular fix as it's causing major issues with our current course content. Is this something we could patch independently of running a full upgrade? Thanks in advance!!
            ankit_frenz Ankit Agarwal made changes -
            Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Not sure if it is related but am getting the following error in 2.2 during restore (merging in current course)

            INSERT INTO mdl_grade_grades (userid,rawgrade,rawgrademax,rawgrademin,rawscaleid,usermodified,finalgrade,hidden,locked,locktime,exported,overridden,excluded,feedback,feedbackformat,information,informationformat,timecreated,timemodified,itemid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
            [array (
            0 => '2',
            1 => NULL,
            2 => '100.00000',
            3 => '0.00000',
            4 => NULL,
            5 => NULL,
            6 => '0.00000',
            7 => '0',
            8 => '0',
            9 => '0',
            10 => '0',
            11 => '0',
            12 => '0',
            13 => NULL,
            14 => '0',
            15 => NULL,
            16 => '0',
            17 => NULL,
            18 => NULL,
            19 => '1',
            )]
            Stack trace:
            line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
            line 973 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
            line 1015 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
            line 222 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record()
            line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_gradebook_structure_step->process_grade_grade()
            line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
            line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
            line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
            line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
            line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
            line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
            line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
            line ? of unknownfile: call to progressive_parser->end_tag()
            line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
            line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
            line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
            line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
            line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
            line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
            line 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
            line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
            line 46 of /backup/restore.php: call to restore_ui->execute()

            Will try to debug it tomorrow. Everything went fine in master.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Not sure if it is related but am getting the following error in 2.2 during restore (merging in current course) INSERT INTO mdl_grade_grades (userid,rawgrade,rawgrademax,rawgrademin,rawscaleid,usermodified,finalgrade,hidden,locked,locktime,exported,overridden,excluded,feedback,feedbackformat,information,informationformat,timecreated,timemodified,itemid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [array ( 0 => '2', 1 => NULL, 2 => '100.00000', 3 => '0.00000', 4 => NULL, 5 => NULL, 6 => '0.00000', 7 => '0', 8 => '0', 9 => '0', 10 => '0', 11 => '0', 12 => '0', 13 => NULL, 14 => '0', 15 => NULL, 16 => '0', 17 => NULL, 18 => NULL, 19 => '1', )] Stack trace: line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown line 973 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1015 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 222 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record() line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_gradebook_structure_step->process_grade_grade() line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process() line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk() line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk() line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk() line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk() line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk() line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish() line ? of unknownfile: call to progressive_parser->end_tag() line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse() line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse() line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process() line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute() line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute() line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute() line 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute() line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan() line 46 of /backup/restore.php: call to restore_ui->execute() Will try to debug it tomorrow. Everything went fine in master. Thanks
            Hide
            dmonllao David Monllaó added a comment -

            Hi Ankit,

            It doesn't seems to be related with this issue, the error your are receiving is related with grade_grades and the grade letters are only representations of grades, they don't have a DB association with grade_grades.

            I'm unable to reproduce the problem, is possible that you have corrupted grade records in your DB?

            Show
            dmonllao David Monllaó added a comment - Hi Ankit, It doesn't seems to be related with this issue, the error your are receiving is related with grade_grades and the grade letters are only representations of grades, they don't have a DB association with grade_grades. I'm unable to reproduce the problem, is possible that you have corrupted grade records in your DB?
            Hide
            dmonllao David Monllaó added a comment -

            Ankit, I've reproduced the problem in 2.2 (integration) in a course with some activities and without system grade letters overwritten, but I can't reproduced in the latest 2.2 weekly release. I'll continue finding the origin of the problem when I finish the meeting

            Show
            dmonllao David Monllaó added a comment - Ankit, I've reproduced the problem in 2.2 (integration) in a course with some activities and without system grade letters overwritten, but I can't reproduced in the latest 2.2 weekly release. I'll continue finding the origin of the problem when I finish the meeting
            Hide
            dmonllao David Monllaó added a comment -

            Hi Ankit, I've also been able to reproduce the problem in 22 STABLE, you only need to have a course with students and a graded activity, when you restore the course backup merging changes the expection is thrown

            Show
            dmonllao David Monllaó added a comment - Hi Ankit, I've also been able to reproduce the problem in 22 STABLE, you only need to have a course with students and a graded activity, when you restore the course backup merging changes the expection is thrown
            dmonllao David Monllaó made changes -
            Link This issue testing discovered MDL-32644 [ MDL-32644 ]
            Hide
            dmonllao David Monllaó added a comment -
            Show
            dmonllao David Monllaó added a comment - Adding a link to http://tracker.moodle.org/browse/MDL-32644
            Hide
            nebgor Aparup Banerjee added a comment -

            Hi Susan,
            you can possibly pick these commits from our integration.git repository or even better, cherry-pick it soon (by this week) from our upstream moodle.git repository:

            integration:
            http://git.moodle.org/gw?p=integration.git&a=search&h=refs%2Fheads%2FMOODLE_23_STABLE&st=commit&s=MDL-29598
            moodle (will show up by soon after weekly roll):
            http://git.moodle.org/gw?p=moodle.git&a=search&h=refs%2Fheads%2FMOODLE_23_STABLE&st=commit&s=MDL-29598

            The patch doesn't seem to affect any upgrade data (or path) as it puts in more checks before inserting records. However i would recommend here backups and extra testing.

            As always, best approach is still working towards upgrading moodle itself.

            ps: i'm curious as to what would be blocking a 2.3.1 --> upcoming 2.3.2 though.

            Show
            nebgor Aparup Banerjee added a comment - Hi Susan, you can possibly pick these commits from our integration.git repository or even better, cherry-pick it soon (by this week) from our upstream moodle.git repository: integration: http://git.moodle.org/gw?p=integration.git&a=search&h=refs%2Fheads%2FMOODLE_23_STABLE&st=commit&s=MDL-29598 moodle (will show up by soon after weekly roll): http://git.moodle.org/gw?p=moodle.git&a=search&h=refs%2Fheads%2FMOODLE_23_STABLE&st=commit&s=MDL-29598 The patch doesn't seem to affect any upgrade data (or path) as it puts in more checks before inserting records. However i would recommend here backups and extra testing. As always, best approach is still working towards upgrading moodle itself. ps: i'm curious as to what would be blocking a 2.3.1 --> upcoming 2.3.2 though.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Passing the test as it is working on other branches. I was not able to test it in 22 because of the linked issue.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Passing the test as it is working on other branches. I was not able to test it in 22 because of the linked issue. Thanks
            ankit_frenz Ankit Agarwal made changes -
            Status Testing in progress [ 10011 ] Tested [ 10006 ]
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            I'm so proud...of you, many thanks!

            http://youtu.be/n64CdfDRnZY

            Closing as fixed, ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - I'm so proud...of you, many thanks! http://youtu.be/n64CdfDRnZY Closing as fixed, ciao
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Tested [ 10006 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]
            Currently in integration Yes [ 10041 ]
            Integration date 31/Aug/12
            stronk7 Eloy Lafuente (stronk7) made changes -
            Fix Version/s STABLE Sprint 23 Alpha [ 12358 ]

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12