<br />
<b>Deprecated</b>: explode(): Passing null to parameter #2 ($string) of type string is deprecated in <b>/var/www/emoncms/Modules/input/input_model.php</b> on line <b>601</b><br />
{"success":false,"message":"Input processlist was not updated"}
I’m anticipating that a PHP update has broken it
I’m on 11.9.13 although I haven’t restarted the machine since updating.
I fed the problem to CoPilot and it suggested the Set command was expecting a JSON format. CoPilot didn’t seem to think that would work directly as a URL though.
[type or paste code here](http://192.168.x.x/input/process/set?inputid=43411&processlist=1:110,34:111,1:76,34:77,2:0.001,process__kwh_accumulator:78,1:83)
<br />
<b>Deprecated</b>: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in <b>/var/www/emoncms/Modules/process/process_model.php</b> on line <b>353</b><br />
{"success":false,"message":"Invalid process list format: "}
I’ve tried a single pair, a JSON Array and a JSON - both with just the accumulator setting. All the same error.
The error message given isn’t so helpful as it seems to be missing a parameter/similar after the :.
The deprecation warning is similarly from PHP 8.1, and should be worked around, but again, shouldn’t be causing the issue.
public function validate_processlist($userid, $id, $processlist, $context_type = 0)
{
$userid = (int) $userid;
$id = (int) $id;
$processes = $this->process_list; // Get the process list
$processes = $this->filter_valid($processes, $context_type); // Filter the process list based on context type
// Process list expected in new JSON format
$processlist = json_decode($processlist, true);
if (json_last_error() !== JSON_ERROR_NONE) {
return array('success' => false, 'message' => tr("Invalid process list format: "));
}
if (!is_array($processlist)) {
return array('success' => false, 'message' => tr("Process list must be an array"));
}
It seems a bit odd to be having a parameter passed in called processlist and then taking $this->process_list and filtering it to $processes and then doing the json_decode on the parameter passed in… That’s potentially work being done that won’t be used because of the error.
Trying to follow the data flow from GitHub isn’t the easiest, I’d have to open it in a proper IDE to have a better look.