Skip to content

Commit

Permalink
Merge pull request #169 from catalyst/issue137-V1-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 526f2e3 + aab56d0 commit ba4c5b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions classes/form/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,20 @@ public function definition() {
$mform->setDefault('dividerselector', 'filler');
}

$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 @@ -143,8 +143,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 ba4c5b1

Please sign in to comment.