Needs review
Project:
Content Construction Kit (CCK)
Version:
6.x-2.9
Component:
number.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2010 at 22:56 UTC
Updated:
6 Dec 2012 at 19:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
jpl-2 commentedWhen this error happens, I can see $start == '1000.00' and $value == '100000' in number_decimal_validate. When the node is saved without #access = FALSE, I see both start and value == '1000,00'.
Comment #2
jpl-2 commentedThe problem is that $element['#value'][$field_key] in number_process ends up with the default decimal separator when #access == FALSE, while it contains the user-entered decimal separator when #access == TRUE and a value was posted. The attached patch deals with this, while still keeping proper validation of the decimal separator in case of posted data.
Comment #3
JThan commentedThx for the patch. The patch worked for me.
I had this problem without setting #access to false via hook_form_alter (but maybe because of using Content Permissions?)
Maybe someone else can review this also?
Comment #4
roderikI had a look at the patch. And my brain froze for a minute.
The patch is good, but I couldn't resist rolling one that's functionally equivalent (in practice), and has some comments. (For which I took a little peek at another CCK module's 'process' function.)
Comment #5
roderikMeh. That is not "functionally equivalent", in that I am filling $element['#value'][$field_key] also when it was unset.
This patch is unfortunately longer, but I think it still reads OK.
By the way: in other issues (like #283341: Illegal value in text field; field's array is being changed) I've seen references to 'drupal_execute() not working', which relate to incorrect internal values, just like this one. So it seems better to drop the explicit references to #access = FALSE, in the patch.