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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 3.9.3
    • 3.9
    • Installation
    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • 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

      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.

            matteo Matteo Scaramuccia
            matteo Matteo Scaramuccia
            Paul Holden Paul Holden
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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