Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jan 2015 at 23:24 UTC
Updated:
4 Mar 2015 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirThe UI or storage?
Comment #2
amitsedaiz commentedThe issue occurs at the field UI level. It happens when creating a new field (Decimal or float) or editing the field ui settings. The problem happens for Default Value, Min and Max Value.
Also, when creating the field for the first time, the system does not validate if the default value is greater than the max value specified in the field ui settings. It does however validate during editing the field ui settings,
Comment #3
amitsedaiz commentedHi,
I have created a patch. It works for me. Kindly review.
Comment #4
penyaskitoThanks for working on this!
IMHO we should do this by overriding the method in FieldType/DecimalItem and FieldType/FloatItem instead of adding an if-case.
Also, this would need tests and an issue summary update.
Comment #5
yesct commented@amitsedaiz
Thank you for working on this issue.
We should all try and use the same sprint tag. According to https://groups.drupal.org/node/447258 it should be SprintWeekend2015 with no #.
Comment #6
gloob commentedStarting to work on this issue.
Comment #7
gloob commentedMoved logic for the redefinition of the form settings into FieldType/DecimalItem and FieldType/FloatItem.
I didn't find current tests for Fieldtypes in the code so I didn't add a new test case, probably it should be a complete test definition that should be covered in a new ticket?
Find some problems in the way we are representing decimal points in the UI, I'll create a new ticket for that.
Comment #8
yesct commented@gloob
We can make a new issue to add more complete test coverage, but the bug for just this one part needs to have a test in *this* issue.
Try writing a test and stick it somewhere, reviews of the test will help improve any first try you do at it. :)
Comment #9
penyaskitoNeeds work per #8.
Comment #10
geertvd commentedComment #11
geertvd commentedComment #13
penyaskitoThis looks awesome! Thanks @geertvd for your contribution!
Next time you should try to upload an interdiff too.
Can we get an update to the issue summary?
Comment #14
geertvd commentedDidn't think an interdiff was necessary since I just added the test.
Comment #15
penyaskitoMy fault then, sorry!
Comment #16
penyaskitoAdded beta evaluation template, IMHO we are good to go!
Comment #17
penyaskitoComment #18
alexpottThis is a negative test and therefore very fragile - it should at least be accompanied by a positive assertion that what we expected to occur has occurred.
Comment #19
geertvd commentedSomething like this should cover that.
Comment #21
penyaskito#18 was taken care of and looks good.
Comment #22
gloob commentedThis issue fix two problems at once. The float field and decimal field. I would say we need additional test also for the decimal field.
Comment #23
alexpottNice catch @gloob. Let's add a test for decimal too.
Comment #24
geertvd commentedAdded the decimal field test and a helper function to make it all a bit more readable
Comment #25
geertvd commentedComment #27
gloob commentedLooks good for me. Great job @geertvd! :-)
Comment #28
alexpottPerhaps this should be a float like
0.0001- something that would not work for a decimal field.If this is called assertSetMinimumValue() simpletest will report a more useful line number..
Let's also assert some form of success message.
Comment #29
geertvd commentedComment #31
pjbaertChanges suggested by @alexpott are implemented
Comment #33
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 0d15b2b and pushed to 8.0.x. Thanks!