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

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.9
    • Fix Version/s: 3.9.3
    • Component/s: Installation
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.9 Branch:
      m39_MDL-68536_Notice_Undefined_Property_CFG_branch
    • Pull 3.10 Branch:
      m310_MDL-68536_Notice_Undefined_Property_CFG_branch
    • Pull Master Branch:
      m40_MDL-68536_Notice_Undefined_Property_CFG_branch

      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

              Assignee:
              matteo Matteo Scaramuccia
              Reporter:
              matteo Matteo Scaramuccia
              Peer reviewer:
              Paul Holden Paul Holden
              Integrator:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Tester:
              Janelle Barcega Janelle Barcega
              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:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                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