Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module works great for my text fields, however attempting to fill in a token for an integer field and node_type_form fails validation because the default field is a token, which is technically text, rather than being numbers.
Comment | File | Size | Author |
---|---|---|---|
#15 | field_default_token-bigint_support-2209955-9-7.x-1.3.patch | 1.46 KB | maximkashuba |
Comments
Comment #1
Renee S CreditAttribution: Renee S commentedComment #2
Fernly CreditAttribution: Fernly commentedIssue confirmed. Tokens can not be applied to an integer field because of native validation.
Comment #3
jerry CreditAttribution: jerry commentedYes, I've run into this issue as well.
Comment #5
maximpodorov CreditAttribution: maximpodorov commentedThe fix is committed.
Comment #7
doxigo CreditAttribution: doxigo commentedUsing the latest dev version the issue still exists
Comment #8
maximpodorov CreditAttribution: maximpodorov commentedCould you provide steps to reproduce the bug?
Comment #9
doxigo CreditAttribution: doxigo commented1. Created a BigInt field for a content-type (Phone Number)
2. Used user's default phone number token to fill #1 field
Got the error!
Comment #10
maximpodorov CreditAttribution: maximpodorov commentedIs BigInt field provided by a contrib module?
Comment #11
doxigo CreditAttribution: doxigo commentedYes you can find it here
Comment #12
tchurch CreditAttribution: tchurch commentedHi,
I'm also experiencing this same issue on the Decimal fields (which are part of core?)
"Only numbers and the decimal separator (.) allowed in Price"
Comment #13
maximpodorov CreditAttribution: maximpodorov commented@tchurch, what version do you use? Could you try the latest 7.x-1.3?
Comment #14
kopeboy CreditAttribution: kopeboy commentedI confirm that with the latest stable version 7.x-1.3 you can't add a token in an integer field default value.
I am not talking about contrib modules' fields, it's just a standard integer field.
If you use Number field as widget you can't even write text (browser will block the input).
But even if you set Text field as the widget, and put a token in it, when trying to save you get the "Only numbers are allowed in FIELDNAME." error.
Comment #15
maximkashubaAdds support for bigint field provided by contrib module "bigint".
In addition, while working with core fields as decimal, integer and float i have no problems. Values of these fields are checked by the same validate function 'number_field_widget_validate', so if you try to put token with no proper value (not integer, float or decimal) you will not see result
Comment #16
dmsmidtI had the same problem as #14.
I guess if the field widget is 'number' we should just use the 'text' widget in the Fields UI so that we can input a token.
We should also make sure in the validator the length of the token is not counted for the allowed length.
@maxx0n, I haven't tested your patch, just adding some extra info about what should also be fixed here.
Comment #17
dmsmidt@maxx0n and @kopeboy, sorry for shamefully promoting another patch. I created one that fixed HTML5 fields like number (and others).
The patch makes the module a bit more generic in some critical places, so we have to create less 'module' specific patches. Even e-mail fields work now. Probably Bigint also works, even without the biging specific patch in #15. Could you test?
Postponing this issue, until some some useful output of #2790059: Support HTML5 Tools and Elements module.