Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299059

Integer field accepts non-integer values with client-side validation disabled. Tries and fails to commit non-int values.

$
0
0

Problem/Motivation

The Integer field will accept integers between a given minimum and maximum value. A validation error is thrown if the number falls outside this range.

But the field does not validate and throw errors for the following cases

  1. non-digit values
  2. non-integer number values

The problem is that these values "pass" validation and the value are then committed. But the database field type is int, and the field value is returned as empty.

Screenshot of a node edit form with an integer field containing the value aa. XDebug is open showing that field validation passes. The Chrome tools are open showing the form has the attribute novalidation

Proposed resolution

Add validation for non-digit values and non-integer values.

Add 2 tests, for each validation case.

Remaining tasks

Write the validation cases.
Write the tests.

User interface changes

None.

API changes

None.


Viewing all articles
Browse latest Browse all 299059

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>