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

1.21.6 : enable to empty multiple field #728

Closed
EC2311 opened this issue Nov 20, 2023 · 18 comments · Fixed by #733
Closed

1.21.6 : enable to empty multiple field #728

EC2311 opened this issue Nov 20, 2023 · 18 comments · Fixed by #733

Comments

@EC2311
Copy link

EC2311 commented Nov 20, 2023

Hello

in 1.21.6 : no possibility to empty multiple field

Thanks

@supermenteur
Copy link

Same here

@stonebuzz
Copy link
Contributor

Hi,
can you try this

#728

Best regards

@EC2311
Copy link
Author

EC2311 commented Dec 1, 2023

Hello

same thing : no progress
field is not empty after save the record

@stonebuzz
Copy link
Contributor

HI @EC2311
Can you clear the GLPI cache and check that you've applied the patch?

I'm no longer having the same problem with the fix!

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

Hi @stonebuzz

Which cache do you mean ? Navigator or GLPI ?
I tried to empty glpi one : no progress

In fact, the item is well removed at screen, but when we click on button to backup : then f5 to refresh : it is still there and no move in DB.

the pach seems to be well installed (678804a) only ?

By looking in the table fields_fields, the type recorded of this field is 'dropdown-computer' and not only 'dropdown'
image
by debugging at line 1757 / 1759 : no stop (die)

@stonebuzz
Copy link
Contributor

Have you set a default value in the field configuration?

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

no default value set

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

it seems the 'multiple' field is 0, -> false in fact and never true ?

@stonebuzz
Copy link
Contributor

I do not reproduce =/

I add an item to the dropdown list -> I save -> OK
I remove the item -> I save -> the dropdown list is empty -> OK
I refresh (F5) my page -> dropdown list is empty -> OK

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

My debug :
image

with 2 values in the dropdown :
image

i remove one
image

I try to remove the last
image

image
the isset($item->input[$input]) is not set

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

I added some debug, and trying to solve the issue

image

I added an else when isset($item 1740) is not set

I debuged to see the content of $data at the end

-> the field multiple (in $data) is well returned empty :) but it is not backuped empty :( I don't know why...

have a look at line 1778 -> it's not dropdown but dropdown-computer I have to test

@stonebuzz
Copy link
Contributor

I repdoduced

image

But you don't use a multiple field (dropdown)
you are using a GLPI Item field (which is a dropdown but not multiple)

@EC2311
Copy link
Author

EC2311 commented Dec 5, 2023

oups,
OK sorry for the 'wrong' input :(

the field is an glpi item : ok (computer) but it is multiple too : we can add 'n' computers in the field

@stonebuzz
Copy link
Contributor

stonebuzz commented Dec 7, 2023

@EC2311
I've just updated the PR, the latest commit should fix your problem

@stonebuzz
Copy link
Contributor

@supermenteur
can you check this ?

#733

@EC2311
Copy link
Author

EC2311 commented Dec 7, 2023

Hi @stonebuzz,

its' ok for me : the item (here computer) is well empty 👍
thanks a lot
and sorry for the wrong input

@supermenteur
Copy link

supermenteur commented Dec 7, 2023 via email

@stonebuzz
Copy link
Contributor

@supermenteur

Contact your partner to ask us to do so =)

++

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

Successfully merging a pull request may close this issue.

3 participants