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

"Found more than one record in fetch() !" on duplicating activity

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1, 2.8.1
    • Fix Version/s: None
    • Component/s: Assignment, Feedback, Gradebook
    • Labels:
    • Environment:
      CentOS release 5.6 (Final)
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Given a course with a user1 enrolled, and teacher1 and teacher2 enrolled, and an Feedback activity defined...

      1. Log in as admin
      2. Visit the course page
      3. Turn editing on
      4. Click the "x2" duplicate icon next to the Feedback activity
      5. At the "Are you sure..." page, Click "Continue"
      6. At the "duplicated successfully" page, click "Edit the new copy"
      7. On the "Updating Feedback" page, make no changes, but scroll to the bottom of the page and click "Save and return to course"
      8. Turn editing off
      9. Log out, log back in as an enrolled student, and try to access the course.

      Show
      Given a course with a user1 enrolled, and teacher1 and teacher2 enrolled, and an Feedback activity defined... 1. Log in as admin 2. Visit the course page 3. Turn editing on 4. Click the "x2" duplicate icon next to the Feedback activity 5. At the "Are you sure..." page, Click "Continue" 6. At the "duplicated successfully" page, click "Edit the new copy" 7. On the "Updating Feedback" page, make no changes, but scroll to the bottom of the page and click "Save and return to course" 8. Turn editing off 9. Log out, log back in as an enrolled student, and try to access the course.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_28_STABLE

      Description

      On (stupidly) duplicating a Feedback activity, clicking continue, and then immediately clicking Save and return to course, I got the "Found more than one record in fetch() !" page. Now I can't access the course (http://my.internalhost.net/moodle/course/view.php?id=2) as the teacher or student logins that were enrolled in the course.

      I tried resetting the course, but the error recurs.

      Enrolling as previously unenrolled students works fine.

      Any help on restoring this course for formerly enrolled logins appreciated.

        Gliffy Diagrams

          Issue Links

            Activity

            tedo Ted Osborne created issue -
            tedo Ted Osborne made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Major [ 3 ]
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for reporting that.

            It looks like the Feedback activity backup/restore for duplucation is not working properly.

            As an immediate fix, you might need to hunt down the entry for the duplicate Feedback activity in the feedback table and delete it.

            Show
            salvetore Michael de Raadt added a comment - Thanks for reporting that. It looks like the Feedback activity backup/restore for duplucation is not working properly. As an immediate fix, you might need to hunt down the entry for the duplicate Feedback activity in the feedback table and delete it.
            salvetore Michael de Raadt made changes -
            Fix Version/s STABLE backlog [ 10463 ]
            Labels triaged
            Assignee moodle.com [ moodle.com ] Andreas Grabs [ grabs ]
            Component/s Feedback [ 10302 ]
            salvetore Michael de Raadt made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            Hide
            tedo Ted Osborne added a comment -

            I just upgraded to 2.1.2 and the formerly enrolled users are still locked out with that "Found more than one record..." error.

            And I just took a quick peek at the feedback table, and there's only one row. Maybe it's in one of the other feedback tables. Thanks!

            Show
            tedo Ted Osborne added a comment - I just upgraded to 2.1.2 and the formerly enrolled users are still locked out with that "Found more than one record..." error. And I just took a quick peek at the feedback table, and there's only one row. Maybe it's in one of the other feedback tables. Thanks!
            Hide
            grabs Andreas Grabs added a comment -

            Hi Ted,

            I am sorry but I can not reproduce your issue. Can you give me some more infos about it?
            What exactly does the error show? Did you tried to turn on debugging to get more informations?

            Best regards Andreas

            Show
            grabs Andreas Grabs added a comment - Hi Ted, I am sorry but I can not reproduce your issue. Can you give me some more infos about it? What exactly does the error show? Did you tried to turn on debugging to get more informations? Best regards Andreas
            Hide
            tedo Ted Osborne added a comment -

            I'm sorry, I'm a new user, so I didn't even realize there was a debugging option. I'll give it a spin.

            Show
            tedo Ted Osborne added a comment - I'm sorry, I'm a new user, so I didn't even realize there was a debugging option. I'll give it a spin.
            Hide
            tedo Ted Osborne added a comment -

            Just turned on debugging and the error page showed:

            Notice: Trying to get property of non-object in /var/www/html/moodle/lib/completionlib.php on line 845 Notice: Trying to get property of non-object in /var/www/html/moodle/lib/completionlib.php on line 846

            and...

             
            Stack trace: 
            line 429 of /lib/setuplib.php: moodle_exception thrown
            line 130 of /lib/completion/data_object.php: call to print_error()
            line 83 of /lib/completion/completion_aggregation.php: call to data_object::fetch_helper()
            line 65 of /lib/completion/data_object.php: call to completion_aggregation::fetch()
            line 374 of /lib/completionlib.php: call to data_object->__construct()
            line 208 of /blocks/completionstatus/block_completionstatus.php: call to completion_info->get_aggregation_method()
            line 280 of /blocks/moodleblock.class.php: call to block_completionstatus->get_content()
            line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
            line 924 of /lib/blocklib.php: call to block_base->get_content_for_output()
            line 976 of /lib/blocklib.php: call to block_manager->create_block_contents()
            line 349 of /lib/blocklib.php: call to block_manager->ensure_content_created()
            line 7 of /theme/leatherbound/layout/general.php: call to block_manager->region_has_content()
            line 654 of /lib/outputrenderers.php: call to include()
            line 612 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
            line ? of unknownfile: call to core_renderer->header()
            line 1291 of /lib/setuplib.php: call to call_user_func_array()
            line 196 of /course/view.php: call to bootstrap_renderer->__call()
            line 196 of /course/view.php: call to bootstrap_renderer->header()

            Thanks,

            Ted

            Show
            tedo Ted Osborne added a comment - Just turned on debugging and the error page showed: Notice: Trying to get property of non-object in /var/www/html/moodle/lib/completionlib.php on line 845 Notice: Trying to get property of non-object in /var/www/html/moodle/lib/completionlib.php on line 846 and... Stack trace: line 429 of /lib/setuplib.php: moodle_exception thrown line 130 of /lib/completion/data_object.php: call to print_error() line 83 of /lib/completion/completion_aggregation.php: call to data_object::fetch_helper() line 65 of /lib/completion/data_object.php: call to completion_aggregation::fetch() line 374 of /lib/completionlib.php: call to data_object->__construct() line 208 of /blocks/completionstatus/block_completionstatus.php: call to completion_info->get_aggregation_method() line 280 of /blocks/moodleblock.class.php: call to block_completionstatus->get_content() line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents() line 924 of /lib/blocklib.php: call to block_base->get_content_for_output() line 976 of /lib/blocklib.php: call to block_manager->create_block_contents() line 349 of /lib/blocklib.php: call to block_manager->ensure_content_created() line 7 of /theme/leatherbound/layout/general.php: call to block_manager->region_has_content() line 654 of /lib/outputrenderers.php: call to include() line 612 of /lib/outputrenderers.php: call to core_renderer->render_page_layout() line ? of unknownfile: call to core_renderer->header() line 1291 of /lib/setuplib.php: call to call_user_func_array() line 196 of /course/view.php: call to bootstrap_renderer->__call() line 196 of /course/view.php: call to bootstrap_renderer->header() Thanks, Ted
            Hide
            tedo Ted Osborne added a comment -

            More debugging info: As the admin user, I visited the course page and under Settings I clicked Course administration > Completion tracking and got another Found more than one record in fetch() ! error page with the following stack trace:

            Stack trace:
            line 429 of /lib/setuplib.php: moodle_exception thrown
            line 130 of /lib/completion/data_object.php: call to print_error()
            line 83 of /lib/completion/completion_aggregation.php: call to data_object::fetch_helper()
            line 65 of /lib/completion/data_object.php: call to completion_aggregation::fetch()
            line 374 of /lib/completionlib.php: call to data_object->__construct()
            line 65 of /course/completion_form.php: call to completion_info->get_aggregation_method()
            line 154 of /lib/formslib.php: call to course_completion_form->definition()
            line 73 of /course/completion.php: call to moodleform->moodleform()

            Show
            tedo Ted Osborne added a comment - More debugging info: As the admin user, I visited the course page and under Settings I clicked Course administration > Completion tracking and got another Found more than one record in fetch() ! error page with the following stack trace: Stack trace: line 429 of /lib/setuplib.php: moodle_exception thrown line 130 of /lib/completion/data_object.php: call to print_error() line 83 of /lib/completion/completion_aggregation.php: call to data_object::fetch_helper() line 65 of /lib/completion/data_object.php: call to completion_aggregation::fetch() line 374 of /lib/completionlib.php: call to data_object->__construct() line 65 of /course/completion_form.php: call to completion_info->get_aggregation_method() line 154 of /lib/formslib.php: call to course_completion_form->definition() line 73 of /course/completion.php: call to moodleform->moodleform()
            Hide
            tedo Ted Osborne added a comment -

            Looking at the database, I see a couple of the tables somehow got identical rows as a result of the duplication attempt.

            INSERT INTO `mdl_course_completion_aggr_methd` (`id`, `course`, `criteriatype`, `method`, `value`) VALUES
            (21,	2,	NULL,	1,	NULL),
            (22,	2,	4,	1,	NULL),
            (23,	2,	8,	1,	NULL),
            (24,	2,	7,	2,	NULL),
            (25,	2,	NULL,	1,	NULL),
            (26,	2,	4,	1,	NULL),
            (27,	2,	8,	1,	NULL),
            (28,	2,	7,	2,	NULL);

            INSERT INTO `mdl_feedback_item` (`id`, `feedback`, `template`, `name`, `label`, `presentation`, `typ`, `hasvalue`, `position`, `required`, `dependitem`, `dependvalue`, `options`) VALUES
            (2,	1,	0,	'label',	'',	'<h4>Please rate the overall training format and materials.</h4>',	'label',	0,	1,	0,	0,	'',	''),
            (6,	1,	0,	'label',	'',	'<h4>Please rate the usefulness of the content presented in this course.</h4>',	'label',	0,	7,	0,	0,	'',	''),
            (9,	1,	0,	'label',	'',	'<h4>Please provide any specific feedback you have.</h4>',	'label',	0,	10,	0,	0,	'',	''),
            (10,	1,	0,	'Was there anything you expected to learn that wasn\'t covered?',	'comments',	'40|5',	'textarea',	1,	11,	0,	0,	'',	''),
            (11,	1,	0,	'Any other comments?',	'comments',	'40|5',	'textarea',	1,	13,	0,	0,	'',	''),
            (12,	1,	0,	'What would have improved this course?',	'comments',	'40|5',	'textarea',	1,	12,	0,	0,	'',	''),
            (13,	1,	0,	'The course provided enough information on the concepts it covered.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	2,	1,	0,	'',	'h'),
            (14,	1,	0,	'The presentation materials and visual aids supported my learning.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	3,	1,	0,	'',	'h'),
            (15,	1,	0,	'The material was easy to understand.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	4,	1,	0,	'',	'h'),
            (16,	1,	0,	'The pacing of the presentation was:',	'materials',	'r>>>>>1####Too slow\r|2####Just about right\r|3####Too fast',	'multichoicerated',	1,	5,	1,	0,	'',	'h'),
            (17,	1,	0,	'Overall, it took the right amount of time to work through this material to learn what I needed to know.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	6,	1,	0,	'',	'h'),
            (18,	1,	0,	'The material in this course will help me in my work at this company.',	'value',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	8,	1,	0,	'',	'h'),
            (19,	1,	0,	'I would recommend this course to a colleague.',	'value',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	9,	1,	0,	'',	'h'),
            (20,	0,	1,	'label',	'',	'<p>Please rate the overall training format and materials.</p>',	'label',	0,	1,	0,	0,	'',	''),
            (21,	0,	1,	'label',	'',	'<p>Please rate the usefulness of the content presented in this course.</p>',	'label',	0,	7,	0,	0,	'',	''),
            (22,	0,	1,	'label',	'',	'<p>Please provide any specific feedback you have.</p>',	'label',	0,	10,	0,	0,	'',	''),
            (23,	0,	1,	'Was there anything you expected to learn that wasn\'t covered?',	'comments',	'40|5',	'textarea',	1,	11,	0,	0,	'',	''),
            (24,	0,	1,	'Any other comments?',	'comments',	'40|5',	'textarea',	1,	13,	0,	0,	'',	''),
            (25,	0,	1,	'What would have improved this course?',	'comments',	'40|5',	'textarea',	1,	12,	0,	0,	'',	''),
            (26,	0,	1,	'The course provided enough information on the concepts it covered.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	2,	1,	0,	'',	'h'),
            (27,	0,	1,	'The presentation materials and visual aids supported my learning.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	3,	1,	0,	'',	'h'),
            (28,	0,	1,	'The material was easy to understand.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	4,	1,	0,	'',	'h'),
            (29,	0,	1,	'The pacing of the presentation was:',	'materials',	'r>>>>>1####Too slow\r|2####Just about right\r|3####Too fast',	'multichoicerated',	1,	5,	1,	0,	'',	'h'),
            (30,	0,	1,	'Overall, it took the right amount of time to work through this material to learn what I needed to know.',	'materials',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	6,	1,	0,	'',	'h'),
            (31,	0,	1,	'The material in this course will help me in my work at this company.',	'value',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	8,	1,	0,	'',	'h'),
            (32,	0,	1,	'I would recommend this course to a colleague.',	'value',	'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree',	'multichoicerated',	1,	9,	1,	0,	'',	'h');

            Show
            tedo Ted Osborne added a comment - Looking at the database, I see a couple of the tables somehow got identical rows as a result of the duplication attempt. INSERT INTO `mdl_course_completion_aggr_methd` (`id`, `course`, `criteriatype`, `method`, `value`) VALUES (21, 2, NULL, 1, NULL), (22, 2, 4, 1, NULL), (23, 2, 8, 1, NULL), (24, 2, 7, 2, NULL), (25, 2, NULL, 1, NULL), (26, 2, 4, 1, NULL), (27, 2, 8, 1, NULL), (28, 2, 7, 2, NULL); INSERT INTO `mdl_feedback_item` (`id`, `feedback`, `template`, `name`, `label`, `presentation`, `typ`, `hasvalue`, `position`, `required`, `dependitem`, `dependvalue`, `options`) VALUES (2, 1, 0, 'label', '', '<h4>Please rate the overall training format and materials.</h4>', 'label', 0, 1, 0, 0, '', ''), (6, 1, 0, 'label', '', '<h4>Please rate the usefulness of the content presented in this course.</h4>', 'label', 0, 7, 0, 0, '', ''), (9, 1, 0, 'label', '', '<h4>Please provide any specific feedback you have.</h4>', 'label', 0, 10, 0, 0, '', ''), (10, 1, 0, 'Was there anything you expected to learn that wasn\'t covered?', 'comments', '40|5', 'textarea', 1, 11, 0, 0, '', ''), (11, 1, 0, 'Any other comments?', 'comments', '40|5', 'textarea', 1, 13, 0, 0, '', ''), (12, 1, 0, 'What would have improved this course?', 'comments', '40|5', 'textarea', 1, 12, 0, 0, '', ''), (13, 1, 0, 'The course provided enough information on the concepts it covered.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 2, 1, 0, '', 'h'), (14, 1, 0, 'The presentation materials and visual aids supported my learning.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 3, 1, 0, '', 'h'), (15, 1, 0, 'The material was easy to understand.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 4, 1, 0, '', 'h'), (16, 1, 0, 'The pacing of the presentation was:', 'materials', 'r>>>>>1####Too slow\r|2####Just about right\r|3####Too fast', 'multichoicerated', 1, 5, 1, 0, '', 'h'), (17, 1, 0, 'Overall, it took the right amount of time to work through this material to learn what I needed to know.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 6, 1, 0, '', 'h'), (18, 1, 0, 'The material in this course will help me in my work at this company.', 'value', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 8, 1, 0, '', 'h'), (19, 1, 0, 'I would recommend this course to a colleague.', 'value', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 9, 1, 0, '', 'h'), (20, 0, 1, 'label', '', '<p>Please rate the overall training format and materials.</p>', 'label', 0, 1, 0, 0, '', ''), (21, 0, 1, 'label', '', '<p>Please rate the usefulness of the content presented in this course.</p>', 'label', 0, 7, 0, 0, '', ''), (22, 0, 1, 'label', '', '<p>Please provide any specific feedback you have.</p>', 'label', 0, 10, 0, 0, '', ''), (23, 0, 1, 'Was there anything you expected to learn that wasn\'t covered?', 'comments', '40|5', 'textarea', 1, 11, 0, 0, '', ''), (24, 0, 1, 'Any other comments?', 'comments', '40|5', 'textarea', 1, 13, 0, 0, '', ''), (25, 0, 1, 'What would have improved this course?', 'comments', '40|5', 'textarea', 1, 12, 0, 0, '', ''), (26, 0, 1, 'The course provided enough information on the concepts it covered.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 2, 1, 0, '', 'h'), (27, 0, 1, 'The presentation materials and visual aids supported my learning.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 3, 1, 0, '', 'h'), (28, 0, 1, 'The material was easy to understand.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 4, 1, 0, '', 'h'), (29, 0, 1, 'The pacing of the presentation was:', 'materials', 'r>>>>>1####Too slow\r|2####Just about right\r|3####Too fast', 'multichoicerated', 1, 5, 1, 0, '', 'h'), (30, 0, 1, 'Overall, it took the right amount of time to work through this material to learn what I needed to know.', 'materials', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 6, 1, 0, '', 'h'), (31, 0, 1, 'The material in this course will help me in my work at this company.', 'value', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 8, 1, 0, '', 'h'), (32, 0, 1, 'I would recommend this course to a colleague.', 'value', 'r>>>>>1####Strongly disagree\r|2####Disagree\r|3####Undecided\r|4####Agree\r|5####Strongly agree', 'multichoicerated', 1, 9, 1, 0, '', 'h');
            Hide
            grabs Andreas Grabs added a comment -

            Hi Ted,

            I am sorry, I still can not reproduce your issue . Perhaps there are especially settings for that course. Can you give me the settings for completion-tracking from your course and also from your feedback?
            May be here is a developer who knows more about completion-tracking than me.

            Show
            grabs Andreas Grabs added a comment - Hi Ted, I am sorry, I still can not reproduce your issue . Perhaps there are especially settings for that course. Can you give me the settings for completion-tracking from your course and also from your feedback? May be here is a developer who knows more about completion-tracking than me.
            Hide
            tedo Ted Osborne added a comment -

            Completion tracking for the course is set as:

            • Completion tracking: Enabled, control via completion and activity settings
            • Completion tracking begins on enrolment checkbox: Checked

            Completion tracking for the Feedback activity:

            • Under Restrict access
              • Activity completion condition: (none)
            • Under Activity completion:
              • Completion tracking: Show activity as complete when conditions are met
              • Student must view this activity to complete it checkbox: Cleared
              • View as completed if the feedback is submitted checkbox: Checked
              • Expect completed on... Enable checkbox: Cleared
            Show
            tedo Ted Osborne added a comment - Completion tracking for the course is set as: Completion tracking : Enabled, control via completion and activity settings Completion tracking begins on enrolment checkbox: Checked Completion tracking for the Feedback activity: Under Restrict access Activity completion condition : (none) Under Activity completion : Completion tracking : Show activity as complete when conditions are met Student must view this activity to complete it checkbox: Cleared View as completed if the feedback is submitted checkbox: Checked Expect completed on... Enable checkbox: Cleared
            Hide
            tedo Ted Osborne added a comment -

            I just deleted duplicate records 25-28 from mdl_course_completion_aggr_methd and access to the course is restored for the two enrolled users (one student and one teacher). (BTW, loving Adminer!) I realize the real question remains: How did duplicate records get in there in the first place?

            Show
            tedo Ted Osborne added a comment - I just deleted duplicate records 25-28 from mdl_course_completion_aggr_methd and access to the course is restored for the two enrolled users (one student and one teacher). (BTW, loving Adminer !) I realize the real question remains: How did duplicate records get in there in the first place?
            Hide
            tedo Ted Osborne added a comment -

            This may be a dup of MDL-28180.

            Show
            tedo Ted Osborne added a comment - This may be a dup of MDL-28180 .
            stuartrmealor Stuart R Mealor made changes -
            Labels triaged Partner triaged
            Hide
            tabitha Tabitha Roder added a comment -

            I managed to break a course on our Moodle 2.2 instance and get an error message like this. "Found more than one record in fetch() ! ERROR"

            If someone wants access to it for resolving the bug it is here - http://moodlepilot.unitec.ac.nz/course/view.php?id=63 - and I can give you a temporary login.
            Editing teachers can access the course but students just get that error message.

            In a copy of the same course I deleted the feedback activity and disabled the completion tracking (settings, course administration, edit settings) and found that students can access that course.
            In the real course I just disabled the completing tracking (settings, course administration, edit settings) without deleting the feedback activity and found students could access the course. So although this gives us a fix, it disables one of the coolest features!

            Our current idea on how we can continue to have Moodle 2.2 is to remove the duplicate button from the themes (and reduce the number of themes available to teachers so we don't have to edit so many themes!). If anyone has any better ideas or a resolution to the bug I would be very happy to hear from them! If I can assist in resolving the bug I am dead keen on helping.

            Show
            tabitha Tabitha Roder added a comment - I managed to break a course on our Moodle 2.2 instance and get an error message like this. "Found more than one record in fetch() ! ERROR" If someone wants access to it for resolving the bug it is here - http://moodlepilot.unitec.ac.nz/course/view.php?id=63 - and I can give you a temporary login. Editing teachers can access the course but students just get that error message. In a copy of the same course I deleted the feedback activity and disabled the completion tracking (settings, course administration, edit settings) and found that students can access that course. In the real course I just disabled the completing tracking (settings, course administration, edit settings) without deleting the feedback activity and found students could access the course. So although this gives us a fix, it disables one of the coolest features! Our current idea on how we can continue to have Moodle 2.2 is to remove the duplicate button from the themes (and reduce the number of themes available to teachers so we don't have to edit so many themes!). If anyone has any better ideas or a resolution to the bug I would be very happy to hear from them! If I can assist in resolving the bug I am dead keen on helping.
            Hide
            dougiamas Martin Dougiamas added a comment -

            Should this be a feedback bug? I suspect this might be a completion bug or an activity duplication bug.

            Can someone confirm it happens with other activities too?

            Show
            dougiamas Martin Dougiamas added a comment - Should this be a feedback bug? I suspect this might be a completion bug or an activity duplication bug. Can someone confirm it happens with other activities too?
            dougiamas Martin Dougiamas made changes -
            Assignee Andreas Grabs [ grabs ] moodle.com [ moodle.com ]
            markn Mark Nelson made changes -
            Assignee moodle.com [ moodle.com ] Mark Nelson [ markn ]
            markn Mark Nelson made changes -
            Fix Version/s STABLE Sprint 26 Alpha [ 12368 ]
            Fix Version/s STABLE backlog [ 10463 ]
            markn Mark Nelson made changes -
            Link This issue duplicates MDL-28180 [ MDL-28180 ]
            Hide
            markn Mark Nelson added a comment -

            Can't replicate. The error message suggests it has nothing to do with the Feedback module. I suspect this is related to the issue I listed as a duplicate which has been fixed, closing for now.

            Show
            markn Mark Nelson added a comment - Can't replicate. The error message suggests it has nothing to do with the Feedback module. I suspect this is related to the issue I listed as a duplicate which has been fixed, closing for now.
            markn Mark Nelson made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]
            stronk7 Eloy Lafuente (stronk7) made changes -
            Fix Version/s STABLE Sprint 26 Alpha [ 12368 ]
            Hide
            sharongray99 Sharon Gray added a comment -

            Yes, we have an instance of it happening with something other than the feedback module. When attempting to duplicate an assignment, the instructor got this error:

            Found more than one record in fetch() !"

            Then, when he tried to add a simple assignment, he continued to get this error. (Interestingly, it has only happened to one particular instructor, but it is occurring in three of his courses.)

            Our OS is centOS 7 and we are currently on Moodle 2.8.1+, but it happened back when we were on Moodle 2.4.

            Here is the error we recorded in the error_log file after we enabled debugging.

            [Tue Jan 27 16:47:31.098511 2015] [:error] [pid 21711] [client 216.254.240.114:38099] Database transaction aborted automatically in /var/www/moodle/web/course/modedit.php, referer: http://moodle.augie.edu/moodle/course/modedit.php?add=assign&type=&course=1020&section=1&return=0&sr=0
            [Tue Jan 27 16:47:31.103704 2015] [:error] [pid 21711] [client 216.254.240.114:38099] Default exception handler: Found more than one record in fetch() ! Debug: \nError code: morethanonerecordinfetch\n* line 463 of /lib/setuplib.php: moodle_exception thrown\n* line 163 of /lib/grade/grade_object.php: call to print_error()\n* line 340 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()\n* line 1006 of /lib/grade/grade_item.php: call to grade_item::fetch()\n* line 1018 of /lib/gradelib.php: call to grade_item::fetch_course_item()\n* line 334 of /course/modlib.php: call to grade_regrade_final_grades()\n* line 166 of /course/modlib.php: call to edit_module_post_actions()\n* line 266 of /course/modedit.php: call to add_moduleinfo()\n, referer: http://moodle.augie.edu/moodle/course/modedit.php?add=assign&type=&course=1020&section=1&return=0&sr=0

            Any help would be greatly appreciated!

            Show
            sharongray99 Sharon Gray added a comment - Yes, we have an instance of it happening with something other than the feedback module. When attempting to duplicate an assignment, the instructor got this error: Found more than one record in fetch() !" Then, when he tried to add a simple assignment, he continued to get this error. (Interestingly, it has only happened to one particular instructor, but it is occurring in three of his courses.) Our OS is centOS 7 and we are currently on Moodle 2.8.1+, but it happened back when we were on Moodle 2.4. Here is the error we recorded in the error_log file after we enabled debugging. [Tue Jan 27 16:47:31.098511 2015] [:error] [pid 21711] [client 216.254.240.114:38099] Database transaction aborted automatically in /var/www/moodle/web/course/modedit.php, referer: http://moodle.augie.edu/moodle/course/modedit.php?add=assign&type=&course=1020&section=1&return=0&sr=0 [Tue Jan 27 16:47:31.103704 2015] [:error] [pid 21711] [client 216.254.240.114:38099] Default exception handler: Found more than one record in fetch() ! Debug: \nError code: morethanonerecordinfetch\n* line 463 of /lib/setuplib.php: moodle_exception thrown\n* line 163 of /lib/grade/grade_object.php: call to print_error()\n* line 340 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()\n* line 1006 of /lib/grade/grade_item.php: call to grade_item::fetch()\n* line 1018 of /lib/gradelib.php: call to grade_item::fetch_course_item()\n* line 334 of /course/modlib.php: call to grade_regrade_final_grades()\n* line 166 of /course/modlib.php: call to edit_module_post_actions()\n* line 266 of /course/modedit.php: call to add_moduleinfo()\n, referer: http://moodle.augie.edu/moodle/course/modedit.php?add=assign&type=&course=1020&section=1&return=0&sr=0 Any help would be greatly appreciated!
            Hide
            marina Marina Glancy added a comment -

            Thank you for follow up. I'm reopening this issue for additional investigation

            Show
            marina Marina Glancy added a comment - Thank you for follow up. I'm reopening this issue for additional investigation
            marina Marina Glancy made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            Labels Partner triaged Partner triaging_in_progress
            Assignee Mark Nelson [ markn ]
            marina Marina Glancy made changes -
            Status Reopened [ 4 ] Reopened [ 4 ]
            Summary "Found more than one record in fetch() !" on duplicating feedback activity "Found more than one record in fetch() !" on duplicating activity
            Affects Version/s 2.8.1 [ 14350 ]
            Component/s Assignment [ 12131 ]
            Component/s Gradebook [ 10062 ]
            Component/s Course [ 10057 ]
            Hide
            sharongray99 Sharon Gray added a comment - - edited

            UPDATE: We found the problem! The particular instructor was using hashtags ("#") to denote number 1, number 2, etc. for his course topic headings and in some of his assignments. Those hashtags were being read by the database as remarked out comments! So, Moodle was disregarding everything after the "#", hence what appeared to be duplicate records! I went in and removed all hashtag instances and everything is fine now. Yay!

            Show
            sharongray99 Sharon Gray added a comment - - edited UPDATE: We found the problem! The particular instructor was using hashtags ("#") to denote number 1, number 2, etc. for his course topic headings and in some of his assignments. Those hashtags were being read by the database as remarked out comments! So, Moodle was disregarding everything after the "#", hence what appeared to be duplicate records! I went in and removed all hashtag instances and everything is fine now. Yay!
            Hide
            marina Marina Glancy added a comment -

            Sharon, thank you very much for the update. This does not sound right though, assignment and section names should be treated by database as strings and not as commands.
            I would like to be able to replicate this, can you please write here more details of what is happening:
            1. Did you actually have this problem on Moodle 2.8?
            2. Which DB are you using?
            3. When you said "I went in and removed ..." - what exactly do you mean? Did you edit the activity names?
            4. Do I understand correctly that you get an error trying to duplicate activity that contains '#' in the name but after you edit the activity name you no longer experience the error when duplicating?

            Show
            marina Marina Glancy added a comment - Sharon, thank you very much for the update. This does not sound right though, assignment and section names should be treated by database as strings and not as commands. I would like to be able to replicate this, can you please write here more details of what is happening: 1. Did you actually have this problem on Moodle 2.8? 2. Which DB are you using? 3. When you said "I went in and removed ..." - what exactly do you mean? Did you edit the activity names? 4. Do I understand correctly that you get an error trying to duplicate activity that contains '#' in the name but after you edit the activity name you no longer experience the error when duplicating?
            Hide
            sharongray99 Sharon Gray added a comment -

            1. Yes, we are encountering the problem now and are at Moodle 2.8
            2. [I'll need to find out what database we're using and get back to you.]
            3. Yes, I actually editing the topic name and the assignment titles and descriptions to remove all hashtags.
            4. Actually, we encountered the problem when attempting to add an assignment. The instructor informed me that he had been duplicating assignments, but I only encountered the problem when I tried to add a simple assignment. After I removed all of the hashtags, I was able to add an assignment without getting the "found more than one record in fetch ()!"

            Additional details: With one of his courses, I thought I'd deleted all of the offending hashtags, but still got the error. So, I created a new shell and imported the content into it. I was then able to add an assignment to the new course with no problem. I then wanted to delete the old course, but I was unable to do so! It would hang and display "Deleted - Completion tracking" but wouldn't let me delete the course. (I've actually encountered this problem - being unable to delete a course after it begins having the "found more than one record in fetch()Unable to render embedded object: File (" error - with four of this instructor's courses, but none of our other 600+ courses) not found. I have even gone so far as to remove ALL content from within the courses and changed them to "0" topics, but I STILL cannot delete the courses!)

            Show
            sharongray99 Sharon Gray added a comment - 1. Yes, we are encountering the problem now and are at Moodle 2.8 2. [I'll need to find out what database we're using and get back to you.] 3. Yes, I actually editing the topic name and the assignment titles and descriptions to remove all hashtags. 4. Actually, we encountered the problem when attempting to add an assignment. The instructor informed me that he had been duplicating assignments, but I only encountered the problem when I tried to add a simple assignment. After I removed all of the hashtags, I was able to add an assignment without getting the "found more than one record in fetch ()!" Additional details: With one of his courses, I thought I'd deleted all of the offending hashtags, but still got the error. So, I created a new shell and imported the content into it. I was then able to add an assignment to the new course with no problem. I then wanted to delete the old course, but I was unable to do so! It would hang and display "Deleted - Completion tracking" but wouldn't let me delete the course. (I've actually encountered this problem - being unable to delete a course after it begins having the "found more than one record in fetch() Unable to render embedded object: File (" error - with four of this instructor's courses, but none of our other 600+ courses) not found. I have even gone so far as to remove ALL content from within the courses and changed them to "0" topics, but I STILL cannot delete the courses!)
            Hide
            marina Marina Glancy added a comment -

            Thanks Sharon, please comment here when you know the database. If you have access to your webserver files you can find in config.php something like
            $CFG->dbtype = 'pgsql'; Please do not copy-paste here any other information from config.php except the dbtype.

            Show
            marina Marina Glancy added a comment - Thanks Sharon, please comment here when you know the database. If you have access to your webserver files you can find in config.php something like $CFG->dbtype = 'pgsql'; Please do not copy-paste here any other information from config.php except the dbtype.
            Hide
            sharongray99 Sharon Gray added a comment -

            We are running mysql, specifically version 5.5.40. Its official name is Mariadb.

            Show
            sharongray99 Sharon Gray added a comment - We are running mysql, specifically version 5.5.40. Its official name is Mariadb.
            Hide
            marina Marina Glancy added a comment -

            I'm adding the issue to the backlog, hopefully our devs can look at it soon

            Show
            marina Marina Glancy added a comment - I'm adding the issue to the backlog, hopefully our devs can look at it soon
            marina Marina Glancy made changes -
            Status Reopened [ 4 ] Reopened [ 4 ]
            Labels Partner triaging_in_progress Partner triaged
            Sprint candidate Soon [ 10241 ]
            Hide
            sharongray99 Sharon Gray added a comment -

            Thanks, Marina. It appears to be resolved as far as our instance of this problem is concerned. Removing the "#" signs in the various assignments and in the gradebook seems to have solved the problem, at least for us. Thanks!

            Show
            sharongray99 Sharon Gray added a comment - Thanks, Marina. It appears to be resolved as far as our instance of this problem is concerned. Removing the "#" signs in the various assignments and in the gradebook seems to have solved the problem, at least for us. Thanks!

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: