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

Early access to $CFG->branch in core_plugin_manager::instance()->all_plugins_ok

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 3.9
    • 3.9.3
    • Installation
    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • m39_MDL-68536_Notice_Undefined_Property_CFG_branch
    • m40_MDL-68536_Notice_Undefined_Property_CFG_branch
    • Hide

      (difficulty: easy, requires the ability to install the Moodle database using the CLI comand)

      Prepare the test environment

      1. You can use the Moodle Docker Toolbox, by selecting any DB - the fastest in your setup:

        # export MOODLE_DOCKER_WWWROOT=/path/to/moodle/branch
        # export MOODLE_DOCKER_DB=mysql
        

      Before applying the fix

      1. Start the environment:

        # bin/moodle-docker-compose up -d
        

      2. Install the database using the Moodle CLI; a notice will be printed:

        # bin/moodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --adminpass="test" --adminemail="admin@example.com"
         
        Notice: Undefined property: stdClass::$branch in /var/www/html/lib/classes/plugin_manager.php on line 755
        -------------------------------------------------------------------------------
        == Setting up database ==
        -->System
        ++ Success ++
        [...]
        -->logstore_standard
        ++ Success ++
        Installation completed successfully.
        

      3. Stop the environment, trashing it:

        # bin/moodle-docker-compose down -v
        

      After applying the fix

      1. Start the environment:

        # bin/moodle-docker-compose up -d
        

      2. Install the database using the Moodle CLI; no notice will be printed:

        # bin/moodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --adminpass="test" --adminemail="admin@example.com"
        -------------------------------------------------------------------------------
        == Setting up database ==
        -->System
        ++ Success ++
        [...]
        -->logstore_standard
        ++ Success ++
        Installation completed successfully.
        

      3. Stop the environment, trashing it:

        # bin/moodle-docker-compose down -v
        

      Show
      (difficulty: easy, requires the ability to install the Moodle database using the CLI comand) Prepare the test environment You can use the Moodle Docker Toolbox, by selecting any DB - the fastest in your setup: # export MOODLE_DOCKER_WWWROOT=/path/to/moodle/branch # export MOODLE_DOCKER_DB=mysql Before applying the fix Start the environment: # bin/moodle-docker-compose up -d Install the database using the Moodle CLI; a notice will be printed: # bin/moodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --adminpass="test" --adminemail="admin@example.com"   Notice: Undefined property: stdClass::$branch in /var/www/html/lib/classes/plugin_manager.php on line 755 ------------------------------------------------------------------------------- == Setting up database == -->System ++ Success ++ [...] -->logstore_standard ++ Success ++ Installation completed successfully. Stop the environment, trashing it: # bin/moodle-docker-compose down -v After applying the fix Start the environment: # bin/moodle-docker-compose up -d Install the database using the Moodle CLI; no notice will be printed: # bin/moodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --adminpass="test" --adminemail="admin@example.com" ------------------------------------------------------------------------------- == Setting up database == -->System ++ Success ++ [...] -->logstore_standard ++ Success ++ Installation completed successfully. Stop the environment, trashing it: # bin/moodle-docker-compose down -v

    Description

      If you try to configure just the Moodle DB or install a Moodle instance using CLI, you may encounter:

      Notice: Undefined property: stdClass::$branch in /var/www/html/lib/classes/plugin_manager.php on line 755
      

      due to an early access to $CFG not being completely set.

      Attachments

        Issue Links

          Activity

            People

              matteo Matteo Scaramuccia
              matteo Matteo Scaramuccia
              Paul Holden Paul Holden
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Janelle Barcega Janelle Barcega
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 45 minutes
                  2h 45m