Skip to content
Permalink
Browse files

Don't generate maxlength properties for decimal columns.

Int casting the decimal scale isn't going to work in a number of
situations as users may end up trying to include decimal points, commas
or spaces in larger amounts.

Fixes #5977
  • Loading branch information...
markstory committed Feb 28, 2015
1 parent 54edb1c commit 8dba9879d4c84e434adf4282c68379c2bf07b200
Showing with 1 addition and 1 deletion.
  1. +0 −1 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  2. +1 −0 lib/Cake/View/Helper/FormHelper.php
@@ -782,7 +782,6 @@ public function testTextFieldGenerationForDecimalAsText() {
'type' => 'text',
'name' => 'data[ValidateUser][cost_decimal]',
'id' => 'ValidateUserCostDecimal',
'maxlength' => 6,
)),
'/div'
);
@@ -1287,6 +1287,7 @@ protected function _maxLength($options) {
isset($fieldDef['length']) &&
is_scalar($fieldDef['length']) &&
$fieldDef['length'] < 1000000 &&
$fieldDef['type'] !== 'decimal' &&
$options['type'] !== 'select'
);
if ($autoLength &&

0 comments on commit 8dba987

Please sign in to comment.
You can’t perform that action at this time.