Code of Conduct
Is there an existing issue for this?
GLPI Version
11.0.5
Plugin version
1.23.3
Bug description
When selecting a value in any dropdown (not necessary the custom fields dropdown) of an item with custom fields the dropdown get buggy and doesn't close because of a javascript error.
While debugging I found out that it's the refreshContainer function that fail when the function get multiple_matches and that the current field that matched has an empty string value.
Example with groups_id_tech :

A fix would be to add a check to see if the value is an empty string at this line so it would create an empty array in this case which would make the push method works a few line after :
Relevant log output
Uncaught TypeError: obj[name].push is not a function
at <anonymous>:13:39
at Array.reduce (<anonymous>)
at refreshContainer (<anonymous>:5:104)
at HTMLSelectElement.<anonymous> (<anonymous>:75:29)
at HTMLFormElement.dispatch (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:41760)
at v.handle (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:39643)
at Object.trigger (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:73967)
at HTMLSelectElement.<anonymous> (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:74602)
at A.each (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:3080)
at obj.<computed>.each (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:1458)
Page URL
No response
Steps To reproduce
- Set custom fields on an itemtype
- Set fields which can get multiples values (like groups) with a value
- Try to set the value of a dropdown (the bug should happen instantly and the js error appears in the browser console)
Your GLPI setup information
No response
Anything else?
No response
Code of Conduct
Is there an existing issue for this?
GLPI Version
11.0.5
Plugin version
1.23.3
Bug description
When selecting a value in any dropdown (not necessary the custom fields dropdown) of an item with custom fields the dropdown get buggy and doesn't close because of a javascript error.
While debugging I found out that it's the refreshContainer function that fail when the function get multiple_matches and that the current field that matched has an empty string value.
Example with groups_id_tech :

A fix would be to add a check to see if the value is an empty string at this line so it would create an empty array in this case which would make the push method works a few line after :
fields/inc/field.class.php
Line 1013 in fab59ee
Relevant log output
Uncaught TypeError: obj[name].push is not a function at <anonymous>:13:39 at Array.reduce (<anonymous>) at refreshContainer (<anonymous>:5:104) at HTMLSelectElement.<anonymous> (<anonymous>:75:29) at HTMLFormElement.dispatch (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:41760) at v.handle (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:39643) at Object.trigger (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:73967) at HTMLSelectElement.<anonymous> (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:74602) at A.each (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:3080) at obj.<computed>.each (base.min.js?v=af270aae27c4d597be591a74861f215576327064:11:1458)Page URL
No response
Steps To reproduce
Your GLPI setup information
No response
Anything else?
No response