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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Renee S’s picture

Issue summary: View changes
Fernly’s picture

Issue confirmed. Tokens can not be applied to an integer field because of native validation.

jerry’s picture

Yes, I've run into this issue as well.

  • maximpodorov committed a9b10a4 on 7.x-1.x
    Issue #2209955 by Renee S: Skip element validation for numerical fields
    
maximpodorov’s picture

Status: Active » Fixed

The fix is committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

doxigo’s picture

Status: Closed (fixed) » Active

Using the latest dev version the issue still exists

maximpodorov’s picture

Could you provide steps to reproduce the bug?

doxigo’s picture

1. 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!

maximpodorov’s picture

Is BigInt field provided by a contrib module?

doxigo’s picture

Yes you can find it here

tchurch’s picture

Hi,

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"

maximpodorov’s picture

@tchurch, what version do you use? Could you try the latest 7.x-1.3?

kopeboy’s picture

I 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.

maximkashuba’s picture

Version: 7.x-1.x-dev » 7.x-1.3
Assigned: Unassigned » maximkashuba
Status: Active » Needs review
FileSize
1.46 KB

Adds 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

dmsmidt’s picture

Status: Needs review » Needs work

I 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.

dmsmidt’s picture

Status: Needs work » Postponed

@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.