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

moodle cli cfg.php hard-set filter, filter too much

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.10.7, 3.11.3
    • 3.9.7, 3.10.6, 3.11.2
    • Other
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-71778-master
    • Hide
      Core config setting
      1. Run the following command on your CLI:

        php admin/cli/cfg.php --name=dbhost --set=localhost
        

      2. Make sure the validation message "The configuration variable is hard-set in the config.php, unable to change." is displayed.
      3. Run the following command on your CLI:

        php admin/cli/cfg.php --name=debug --set=0
        

      4. Make sure you don't get an error message.
      Plugin config setting
      1. Run the following command on your CLI:

        php admin/cli/cfg.php --component='logstore_database' --name=dbhost --set=localhost
        

      2. Make sure you don't get an error message.
      3. Add the following line to your config.php:

        $CFG->forced_plugin_settings['logstore_database']['dbhost']='localhost';
        

      4. Run the same command of step 1.
      5. Make sure the validation message "The configuration variable is hard-set in the config.php, unable to change." is displayed.
      Show
      Core config setting Run the following command on your CLI: php admin/cli/cfg.php --name=dbhost --set=localhost Make sure the validation message "The configuration variable is hard-set in the config.php, unable to change." is displayed. Run the following command on your CLI: php admin/cli/cfg.php --name=debug --set=0 Make sure you don't get an error message. Plugin config setting Run the following command on your CLI: php admin/cli/cfg.php --component='logstore_database' --name=dbhost --set=localhost Make sure you don't get an error message. Add the following line to your config.php : $CFG->forced_plugin_settings['logstore_database']['dbhost']='localhost'; Run the same command of step 1. Make sure the validation message "The configuration variable is hard-set in the config.php, unable to change." is displayed.

      In the moodle cli cfg.php the filter to detect ,hard set only compare name of the cfg parameter to $CFG->config_php_settings content.

      But when component is passed as command line argument it is not correct.

      the component and name can be stored in $CFG->forced_plugin_settings content

      Before patch

      Launch moodle command client cfg
       

      php /moodlepath/amdin/cli/cfg.php --component='logstore_database' --name=dbhost --set=localhost

      This will trigger the cli error message : 
      "The configuration variable is hard-set in the config.php, unable to change."
      Whereas the parameter is not set in config.php
       

      After Patch

      After patching cfg.php, the previous command line will pass and localhost will be set for logstore database setting

      The if you add the following entry into config.php : 
       

      $CFG->forced_plugin_settings['logstore_database']['dbhost']='localhost';

      And relaunch moodle cli cfg

      php /moodlepath/amdin/cli/cfg.php --component='logstore_database' --name=dbhost --set=localhost

      the cli error message will be triggered but this is normal since the plugin setting is set through $CFG->forced_plugin_settings variable

            cperves Céline Perves
            cperves Céline Perves
            Simey Lameze Simey Lameze
            Jun Pataleta Jun Pataleta
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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