Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.3
Component:
number.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2007 at 23:39 UTC
Updated:
5 Feb 2007 at 23:53 UTC
The problem is that if you insert text into a number input box (integer or decimal), it replaces your text with the number 0 and stores this into your content.
This is done quietly and the user is not informed that their data was invalid, and that something different was stored into the database.
The text is invalid and should be marked as so, requiring that the user fix the error.
Traced the problem to a regular expression replace that replaced essentially any non-integer with an empty string quietly. Removed this and created a 'is_numeric' check in the number validate function.
| Comment | File | Size | Author |
|---|---|---|---|
| cck_1.3_number.patch | 1.39 KB | nterbogt |
Comments
Comment #1
yched commentedsee http://drupal.org/node/115632
the regexp stuff was added some time ago instead of the original is_numeric in order to allow for greater flexibility, so simply removing is probably not the right fix.