-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
There is an error when creating a Save Point:
Exception - Cannot use object of type stdClass as array
More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:
line 128 of /admin/tool/coursearchiver/step2.php: Error thrown
Potential fix for the issue on line 128 of /admin/tool/coursearchiver/step2.php
- $data = json_decode($formdata);
- if (!empty($resume)) { // Resume from save point.
- $searches = $data;
- $searches["resume"] = true;
- } else {
- $searches = [];
- foreach ($data as $key => $value) {
- $searches["$key"] = $value;
- }
- }
+ $data = json_decode($formdata, true);
+ $searches = is_array($data) ? $data : []; // guard against null/bad JSON
+ if (!empty($resume)) {
+ $searches['resume'] = true;
+ }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels