Using $this->fields to read the current serial number and name isn't reliable.
I didn't realize this at first because the fields are set when creating a computer from a form.
This is done indirectly when checking rights:
Adding a computer "from the code" (e.g. with datainjection) will result in an empty $this->fields array.
Fixed by switching to $this->input, which is filled in this case.
Using
$this->fields
to read the current serial number and name isn't reliable.I didn't realize this at first because the fields are set when creating a computer from a form. This is done indirectly when checking rights:
Adding a computer "from the code" (e.g. with datainjection) will result in an empty
$this->fields
array. Fixed by switching to$this->input
, which is filled in this case.