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

Usertours sort order can be fooled in to being -1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.1
    • Fix Version/s: None
    • Component/s: User Tours
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      Seen in multiple MC sites, the upgrade to 3.6.1 fails because a row in tool_usertours_tours has a sortorder of -1. manually updating the table and setting sortorder of 0 (or some other positive int) causes upgrade to succeed.

       

      stack trace:

       
      Default exception handler: Error writing to database Debug: ERROR:  null value in column "name" violates not-null constraint
      DETAIL:  Failing row contains (7, null, null, null, null, 4, null).
      INSERT INTO m_tool_usertours_tours (name,description,pathmatch,enabled,sortorder,configdata) VALUES($1,$2,$3,$4,$5,$6) RETURNING id
      [array (
        \'name\' => NULL,
        \'description\' => NULL,
        \'pathmatch\' => NULL,
        \'enabled\' => NULL,
        \'sortorder\' => 4,
        \'configdata\' => \'null\',
      )]
      Error code: dmlwriteexception
      * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
      * line 248 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      * line 969 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      * line 1017 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
      * line 521 of /admin/tool/usertours/classes/tour.php: call to pgsql_native_moodle_database->insert_record()
      * line 734 of /admin/tool/usertours/classes/manager.php: call to tool_usertours\\tour->persist()
      * line 859 of /admin/tool/usertours/classes/manager.php: call to tool_usertours\\manager::_move_tour()
      * line 52 of /admin/tool/usertours/db/upgrade.php: call to tool_usertours\\manager::update_shipped_tours()
      * line 636 of /lib/upgradelib.php: call to xmldb_tool_usertours_upgrade()
      * line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
      * line 186 of /admin/cli/upgrade.php: call to upgrade_noncore()
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jtomkinson Jordan Tomkinson
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: