Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #11710 - Validation of checkbox data with multiple values #11925

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Oct 5, 2022

Description

When editing assets with customfields of type checkbox, if the values of the checkboxes are submitted via API they can take the form of an array of this form: [Apple,Pear,Grapes] against the form that the system saves the values: [Apple, Pear, Grapes] (hint, one uses a single comma as delimiter and the other uses a comma and a space). So this PR let both forms when working with this kind of custom fields.

Fixes #11710

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1.10
  • MySQL version: 8.0.23
  • Webserver version: nginx/1.19.8
  • OS version: Debian 10

Checklist:

@inietov inietov changed the base branch from master to develop October 5, 2022 23:47
@snipe snipe changed the title Fixed #11710 Problems in validation of checkbox data with multiple values Fixed #11710 - Validation of checkbox data with multiple values Oct 5, 2022
@snipe snipe merged commit 18663c2 into snipe:develop Oct 5, 2022
@snipe
Copy link
Owner

snipe commented Oct 5, 2022

Looks great, thank you!

@mrdanleey
Copy link

I have a problem now with my custom Checkbox field and the following values:

BIOS wachtwoord ingesteld
Computernaam ingesteld
Image geïnstalleerd op de laptop
BIOS-update geïnstalleerd

I can check every checkbox and the changes are saved in de database but not returned (no checkmarks) when I edit the asset.
I found this change and tried what is does if I revert it in my installation of Snipe-IT. After the reverse I see the checkmarks. So
this is a bug from a bugfix i guess?

I'm using the newest version of Snipe-IT (6.0.12), PHP 8.1.12, Laravel 8.83.25)
Tried other PHP-versions also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems in validation of checkbox data with multiple values
3 participants