NumericField() does not support negative numbers. If I supply "-100" it returns:
'-555' is not a number, only numbers can be accepted for this field
Is this a bug or am I missing something?
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
NumericField() does not support negative numbers. If I supply "-100" it returns:
'-555' is not a number, only numbers can be accepted for this field
Is this a bug or am I missing something?
I get the same error in my custom CMS tab when I try to enter a negative number into the Int field.
For example,
With this
public static $db = array(
'TopMargin' => 'Int',
);
and this
...
new NumericField("TopMargin", "Top Margin"),
...
I get "'-20' is not a number, only numbers can be accepted for this field".
As a result, I am having to use TextField instead.
Perhaps I am missing somethings as well? Negative integers are numbers.
Anyone have any ideas?
Thanks,
Sam
Looks like a bug. I've opened a ticket and posted a patch here: http://open.silverstripe.org/ticket/5116