pluginsGLPI / geninventorynumber

Inventorynumber generation
GNU General Public License v3.0
8 stars 14 forks source link

Fix \s and \n placeholders for datainjection #71

Closed AdrienClairembault closed 1 year ago

AdrienClairembault commented 1 year ago

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: image

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.