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

Survey activity fails when auto_increment_increment is altered due to hard coded id's

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.5.6, 2.5.7, 2.5.8, 2.6.3, 2.6.4, 2.6.5, 2.7, 2.7.1, 2.7.2
    • Survey
    • None
    • MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE

      Survey activity will have no questions if the auto_increment_increment mysql database option is set to something other than 1.

      The surveys are hard coded (in db/install.php) to use the ids of the survey questions. In the survey question table the ids are auto incremented. If the auto increment is 1, this is fine. If the auto increment is not 1, e.g. 10. This results in a miss match. (The survey table has a questions column. This questions column contains the ids of the questions that belong to the survey.)

      To replicate:

      uninstall the survey activity
      alter the auto_increment_increment value to 10 in the mysql server settings
      re-install the survey activity
      add a survey activity to a course
      view the survey and the survey will complain it has no questions.
      Check the database and you will see that the surveys (in the surverys table) now refer to questions that dont exist.

      Potential solution:
      Alter the survey db/install.php file to loop over each question, when it inserts, make a note of that id and add that into the survey rather than hard code it.

            Unassigned Unassigned
            mchaney2010 Mark Chaney
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.