-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
zero could be a value #32616
zero could be a value #32616
Conversation
@rycks maybe the unique key for the field |
@hregis No ... that is really a test : now i have to find the reason why zero is prohibited and why some dictionnaries use that number :-) |
@hregis ok but tinyint could store (int)0 as a value ... no ? i dig into commit history, here is the origin of the test: 20 years before :-) thanks to comments we could understand that race condition : zero and '' could not be desactivated entries ... that's not really what nowdays code do (without comment i can't imagine the real target of that code in current version) ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this fix.
@rycks
Have you something else to add for the error message when you update the dictionary line with "0" as code ?
The protection is here because we want to avoid to have 0 as a code (it generates a lot of trouble). |
@eldy ok, but if the original code was set to zero into sql import from install can user change that value to something else ? that question is to make a good fix. First idea: if code was zero -> read-only cell & value then it could become a "generic" solution |
We shoul dnot be able to change for the dictionnary "nature of product". This property is hard coded at different place in application with some test if (nature == 0) ... or if (nature == 1) then ... so for this dictionnary the value 0 and 1 should not be editable (In the past this was not a dictionnary, dictionary was introduced to allow addition of a third value). and i pushed a fix to have the 0 visible as "0" So i think best fix is to try to retreive same changes done into v20 if we can (if the "always active" is hard coded, in this case no problem to backport, if it uses a new entry in database, in this case we must make a different fix). |
@eldy solution backported from 20.0 |
fix #32615 (i hope) :-)
there is a race condition with zero because empty(0) is true ... then we did not display the value