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

Custom Fields keep Format requirements when switching Form Element #11199

Closed
2 tasks done
Sys-Monitor opened this issue May 25, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels

Comments

@Sys-Monitor
Copy link

Sys-Monitor commented May 25, 2022

Debug mode

Describe the bug

The Format requirement to a specified format, in my case BOOLEAN, is kept when switching Format Element.
Because of this the selection I made during asset creation that contained the custom field did not save and showed incorrect value derived from the old requirement.

The reproduction steps may be applicable on other Formats and other Form Elements.

Reproduction steps

  1. Start creating a Custom Field and for Form Element choose Text Box
  2. Set Format to BOOLEAN
  3. Change Form Element to Radio Buttons
  4. Enter desired Field Values and other info and hit Save
  5. The Custom Field will now be of Element type 'radio' but Format type 'BOOLEAN'.
  6. Use this field when creating an asset and choose any of the radio buttons. Even if the field is set to be required for its Fieldset the asset will save but whatever you chose will not be saved and will show a red (X) as in 'False' for the type BOOLEAN in the asset list.
  7. Edit the asset and the selection will be cleared.

Expected behavior

One should be allowed to choose any of the radio buttons and they should be saved with that chosen value.
It should not require to adhere to whatever Format was first highlighted when using another type of Form Element.

When switching from a Form Element with a Format option to a Form Element without a Format option, the Format requirement should be wiped or plainly set as 'ANY' per default.

Screenshots

image
image
image
image
image

Snipe-IT Version

v6.0.1 - build 7750

Operating System

Ubuntu 22.04 TLS

Web Server

Apache

PHP Version

7.4

Operating System

Windows

Browser

Google Chrome

Version

100.0.4896.127

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

This is reproduceable in the demo.
Can't see any errors being thrown with debug mode on.

$ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zip
zlib

$ cat <installation directory>/storage/logs/laravel.log
[...]
[2022-05-24 16:40:26] <REDACTED>

I.e. no log entry has been generated for this problem as I encountered it today.

Additional context

This is on a fresh install.
I used the git fetch method to install (the one which says it's easy to upgrade).
Installation server side is complete and I've been adding custom fields, sets, vendors, manufacturers, assets, etc..
I have not touched the database in any way, shape or form. I only created it and assigned the Snipe-IT user to it as instructed.

@welcome
Copy link

welcome bot commented May 25, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@snipe snipe added ✋ bug Confirmed bug custom fields labels Jun 7, 2022
snipe added a commit that referenced this issue Sep 15, 2022
…boxes_unaccessible

Fixed #9801 #11199 Default Values for Checkbox Field Types Unaccessible
@inietov inietov closed this as completed Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants