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

install_database.php error Undefined property: stdClass::$branch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.9.1
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
    • Testing Instructions:
      Hide

      Steps

      1. Prepare an uninstalled Moodle site with configured config.php. For example, install a Moodle site using the web interface so that config.php is created. After the installation completes, drop and re-create the database (e.g. DROP DATABASE test39; CREATE DATABASE test39 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; – be certain you are dropping the intended database).

      2. Edit config.php adding the following lines:

      @error_reporting(E_ALL | E_STRICT);
      @ini_set('display_errors', '1');
      $CFG->debug = (E_ALL | E_STRICT);
      $CFG->debugdisplay = 1;

      3. Run admin/cli/install_database.php as the web server user specifying the mandatory parameters, e.g.:

      cd /path/to/moodle

      sudo -u apache php admin/cli/install_database.php --adminpass=Password-1 --adminemail=admin@example.com --agree-license --fullname=Test\ Site --shortname=Home

      Expected results

      The script should run and there should be no PHP notices or errors.

      Show
      Steps 1. Prepare an uninstalled Moodle site with configured config.php . For example, install a Moodle site using the web interface so that config.php is created. After the installation completes, drop and re-create the database (e.g. DROP DATABASE test39; CREATE DATABASE test39 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; – be certain you are dropping the intended database). 2. Edit config.php adding the following lines: @error_reporting(E_ALL | E_STRICT); @ini_set('display_errors', '1'); $CFG->debug = (E_ALL | E_STRICT); $CFG->debugdisplay = 1; 3. Run admin/cli/install_database.php as the web server user specifying the mandatory parameters, e.g.: cd /path/to/moodle sudo -u apache php admin/cli/install_database.php --adminpass=Password-1 --adminemail=admin@example.com --agree-license --fullname=Test\ Site --shortname=Home Expected results The script should run and there should be no PHP notices or errors.
    • Affected Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.9 Branch:
      MDL-69516-undef_property_branch-39
    • Pull 3.10 Branch:
      MDL-69516-undef_property_branch-310
    • Pull Master Branch:
      MDL-69516-undef_property_branch

      Description

      With a configured config.php you can use admin/cli/install_database.php to install Moodle. If debugging is enabled in that config.php you get the warning (Moodle 3.9.1+ Build: 20200814):

      {{# sudo -u apache php admin/cli/install_database.php --agree-license --fullname=...
      PHP Notice: Undefined property: stdClass::$branch in /var/www/scratch39.dell/moodle/lib/classes/plugin_manager.php on line 755

      Notice: Undefined property: stdClass::$branch in /var/www/scratch39.dell/moodle/lib/classes/plugin_manager.php on line 755
      -------------------------------------------------------------------------------
      == Setting up database ==
      ⋮}}

      The installation completes successfully.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              leonstr Leon Stringer
              Reporter:
              leonstr Leon Stringer
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: