snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
9.91k stars 3.01k forks source link

Create asset with API can break checkbox custom tag #14720

Open echristley opened 1 month ago

echristley commented 1 month ago

Debug mode

Describe the bug

Creating an asset via the API allows a device to be created that cannot be checked out, when the API calls specifies a invalid value for a checkbox type custom field.

Work around: Add the invalid value to the field values.

Reproduction steps

  1. create a custom field with checkbox as the form element type
  2. arbitrarily add one or more field values
  3. create an asset via the API, adding a value for the custom field that is not one of the field values
  4. trying to checkout the device gives an error message that the field has an invalid value.

Expected behavior

Since a checkbox type was specified in order to limit the allowed values, the API should reject the invalid value.

Screenshots

No response

Snipe-IT Version

6.3.4 - build 13139

Operating System

snipe-it.io

Web Server

snipe-it.io

PHP Version

1.0

Operating System

N/A

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

The device can not be checked out.

Additional context

This is the cloud version of Snipe-IT.

snipe commented 1 month ago

This may have already been fixed - can you upgrade to latest and check again please?

echristley commented 1 month ago

This may have already been fixed - can you upgrade to latest and check again please?

Ummm? We're using a cloud account. I don't think "upgrade" is an option there.

snipe commented 1 month ago

@echristley ah, then just send us an email at support@snipeitapp.com with your hosted subdomain and we'll get you upgraded in a jiffy. (We generally lag the fleet wide rollout just a little behind the master branch so we can fix issues that come up.)

snipe commented 1 month ago

Quick follow up - is your checkbox field an encrypted custom field, or a regular one?

echristley commented 1 month ago

A regular one.