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

Issue: Saving Checkbox Values #4798

Merged
merged 1 commit into from Mar 27, 2019

Conversation

Projects
None yet
2 participants
@aydreeihn
Copy link
Contributor

commented Mar 14, 2019

This commit fixes an issue where checkboxes could not be edited for inline edit or all field edits.

When a BooleanField is directly passed to the to_database method, you are not able to accurately check to see if old != new. To fix this, I added a new getChanges method to the BooleanField class that will first do a comparison on the raw boolean value (true, false) and then get the value needed for the database. I then made sure that we use that new function when editing all fields together as well.

Additionally, I added a getClean method to the BooleanField class so that $this->_clean for the field would be set to either true or NULL depending on if the box is checked or not and would accurately save to the database when calling $form->saveAnswers()

This fixes Issue #4782

@JediKev JediKev referenced this pull request Mar 18, 2019

Closed

Custom Fields with checkboxes can't be unchecked #4782

2 of 4 tasks complete
Issue: Saving Checkbox Values
This commit fixes an issue where checkboxes could not be edited for inline edit or all field edits.

When a BooleanField is directly passed to the to_database method, you are not able to accurately check to see if old != new. To fix this, I added a new getChanges method to the BooleanField class that will first do a comparison on the raw boolean value (true, false) and then get the value needed for the database. I then made sure that we use that new function when editing all fields together.

Additionally, I added a getClean method to the BooleanField class so that $this->_clean for the field would be set to either true or NULL depending on if the box is checked or not and would accurately save to the database when calling $form->saveAnswers()

@aydreeihn aydreeihn force-pushed the aydreeihn:issue/checkboxes branch from 4c55228 to 03a6e0a Mar 27, 2019

@protich protich merged commit 89838c0 into osTicket:develop-next Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.