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

Install fails if plugins create admin users

XMLWordPrintable

    • Any
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      Fricken hard to test this one entirely.
      Best bet test that you can still install a new site.
      If you are really feelin' leet you could write a hack to add several admin users during installation (as early on as possible) and make sure things still function correctly.

      Show
      Fricken hard to test this one entirely. Best bet test that you can still install a new site. If you are really feelin' leet you could write a hack to add several admin users during installation (as early on as possible) and make sure things still function correctly.

      If you add a local plugin that adds two admin users, the install fails with 'error reading from database' when redirecting to admin user edit page.

      Stack trace looks like this:

      2012-02-29 14:39:52: (mod_fastcgi.c.2699) FastCGI-stderr: Default exception handler: Error reading from database Debug: ERROR:  invalid input syntax for integer: "2,3"
      SELECT * FROM mdl_user WHERE id = $1 AND deleted <> 1
      [array (
        0 => '2,3',
      )]
      * line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
      * line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      * line 678 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      * line 1297 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      * line 1269 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      * line 4125 of /lib/moodlelib.php: call to moodle_database->get_record_select()
      * line 301 of /admin/index.php: call to get_complete_user_data()

      This occurs because it is assumed that there is only one admin at this stage and can be fixed with a small patch (github incoming).

      Applying this change will allow custom plugins to add admin users on install, which can be useful for any partners automating installation processes.

            skodak Petr Skoda
            tlevi Tony Levi
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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