snipe / snipe-it

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

Radio button reset when switching asset models #15007

Open nicholasveronico opened 2 days ago

nicholasveronico commented 2 days ago

Debug mode

Describe the bug

When changing an asset's asset model, the radio button selection is reset. I am unsure if this is intentional; however, the values of other custom fields, such as the listbox, are not reset when changing an asset model. The following video shows the radio button selection being reset:

https://imgur.com/a/HB06QMj

Please note that the Billing custom field shown in the video is present in both asset models.

Thank you so much in advance!

Reproduction steps

  1. Create a custom radiobutton field and add it to two fieldsets used in two different asset models.
  2. Create an asset with one asset model and with the radio button field checked to one of the options and save the asset.
  3. Edit the same asset but change the asset model to a secondary asset model.

The radio button will reset the selection.

Expected behavior

It is expected to keep the selected value of the radio button the same as long as the same field is present in both fieldsets associated with any two different asset models.

Screenshots

https://imgur.com/a/HB06QMj

Snipe-IT Version

v7.0.7 build 14172

Operating System

Ubuntu 20.04

Web Server

Nginx

PHP Version

8.3.8

Operating System

Mac

Browser

Safari, Microsoft Edge

Version

Edge: 126.0.2592.81, Safari: 17.5

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Browser Console Error (happens before changing the asset model, though):
edit:925 
 Uncaught 
TypeError: $ is not a function
    at edit:925:5
(anonymous) @   edit:925

When changing asset models, the following is logged in Snipe-IT's debug:

[17:34:02] LOG.warning: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /config/storage/framework/views/d2583f90a56f99c2c0bc40b509d051ff.php on line 35

I can confirm this issue also occurs on the demo instance. 

PHP Output:
https://hastebin.com/share/zevuhekayu.css

Additional context

This issue occurs on a fresh install and upgrade, on a manual install and Docker install. Data has not been manually edited in the DB.

welcome[bot] commented 2 days ago

👋 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 commented 2 days ago

@marcusmoore can you peep this, or coordinate with @spencerrlongg or @Godmartinz to see who is best suited (and has the bandwidth) to dig deeper? I think this is related to the SC I created last week, so we might able to kill a few birds with one stone.

marcusmoore commented 2 days ago

I'll check it out 👍🏾