Skip to content

Commit

Permalink
Merge pull request #171 from catalyst/issue137-V3-debugging-noise
Browse files Browse the repository at this point in the history
Issue #137: Cleanup debugging noise
  • Loading branch information
brendanheywood authored Mar 22, 2021
2 parents 7022a82 + 399e6e4 commit fef645c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 2 additions & 6 deletions classes/form/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions classes/local/envbarlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fef645c

Please sign in to comment.