File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -177,24 +177,20 @@ public function definition() {
177
177
$ mform ->setDefault ('secretkey ' , envbarlib::get_secret_key ());
178
178
$ mform ->addHelpButton ('secretkeyg ' , 'secretkey ' , 'local_envbar ' );
179
179
180
- $ localid = -1 ;
181
-
182
180
foreach ($ records as $ record ) {
183
181
184
182
$ locked = false ;
185
183
186
184
// Local records set in config.php will be locked for editing.
187
185
if (isset ($ record ->local )) {
188
- $ record ->id = $ localid ;
189
186
$ locked = true ;
190
187
191
188
$ mform ->addElement (
192
189
"hidden " ,
193
- "locked[ {$ localid }] " ,
190
+ "locked[ {$ record -> id }] " ,
194
191
$ locked
195
192
);
196
- $ mform ->setType ("locked[ {$ localid }] " , PARAM_INT );
197
- $ localid --;
193
+ $ mform ->setType ("locked[ {$ record ->id }] " , PARAM_INT );
198
194
}
199
195
200
196
$ id = $ record ->id ;
Original file line number Diff line number Diff line change @@ -230,8 +230,10 @@ public static function get_records() {
230
230
231
231
// Converting them to stdClass and adding a local flag.
232
232
foreach ($ items as $ key => $ value ) {
233
- $ value ['local ' ] = true ;
234
- $ items [$ key ] = (object ) $ value ;
233
+ $ record = (object ) $ value ;
234
+ $ record ->id = $ key . 'LOCAL ' ;
235
+ $ record ->local = true ;
236
+ $ items [$ key ] = $ record ;
235
237
}
236
238
237
239
$ result = array_merge ($ items , $ result );
You can’t perform that action at this time.
0 commit comments