diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 077c8b9..688dbf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,12 +76,7 @@ jobs: # PHPUnit depends on en_AU.UTF-8 locale sudo locale-gen en_AU.UTF-8 - name: Install Moodle - run: | - mkdir ~/.npm-global - npm config set prefix '~/.npm-global' - export PATH=~/.npm-global/bin:$PATH - source ~/.profile - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 + run: moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 env: DB: ${{ matrix.database }} MOODLE_BRANCH: ${{ matrix.moodle-branch }} diff --git a/classes/form/config.php b/classes/form/config.php index 515678f..09a6925 100644 --- a/classes/form/config.php +++ b/classes/form/config.php @@ -177,24 +177,20 @@ public function definition() { $mform->setDefault('secretkey', envbarlib::get_secret_key()); $mform->addHelpButton('secretkeyg', 'secretkey', 'local_envbar'); - $localid = -1; - foreach ($records as $record) { $locked = false; // Local records set in config.php will be locked for editing. if (isset($record->local)) { - $record->id = $localid; $locked = true; $mform->addElement( "hidden", - "locked[{$localid}]", + "locked[{$record->id}]", $locked ); - $mform->setType("locked[{$localid}]", PARAM_INT); - $localid--; + $mform->setType("locked[{$record->id}]", PARAM_INT); } $id = $record->id; diff --git a/classes/local/envbarlib.php b/classes/local/envbarlib.php index 1727e72..2dd10b9 100644 --- a/classes/local/envbarlib.php +++ b/classes/local/envbarlib.php @@ -230,8 +230,10 @@ public static function get_records() { // Converting them to stdClass and adding a local flag. foreach ($items as $key => $value) { - $value['local'] = true; - $items[$key] = (object) $value; + $record = (object) $value; + $record->id = $key . 'LOCAL'; + $record->local = true; + $items[$key] = $record; } $result = array_merge($items, $result);