I need to have "integer" + "select list", are there any plans to support "integer" fields?
I need it for money field, where select list is a currency.

Comments

chi’s picture

Status: Active » Postponed (maintainer needs more info)

Actually Double Field supports only one field type "Double field" with several widget types (Textfield, Select list and so on).
What does "integer field" mean?

clashar’s picture

I meant "integer" value in place of "textfield" widget.

For example I created double field of "Text field & Select list".
But I would like to use "Integer field & Select list"

chi’s picture

Do you want just verify that user-entered value is integer?

clashar’s picture

yes, as required.

chi’s picture

Title: "integer" fields » "integer" validation
Status: Postponed (maintainer needs more info) » Closed (won't fix)

Double field doesn't support validation of user-entered values. I suggest you take look at Field validation module that has the numeric validator.

clashar’s picture

Do you imply that Double field is compatible with Field validation?

chi’s picture

Yes, it works well.

clashar’s picture

good, thank you for quick replies!

hgurol’s picture

Title: "integer" validation » "integer" or "decimal" field type support
Priority: Normal » Major
Status: Closed (won't fix) » Active

Chi,

I believe the original poster didnt clarify the problem very well.
Let me try it myself.

Im using Double Field in more than one instance on my forms and content types. And since this module currently does not support the Integer or in my case the Decimal field, Im forced the use the Text Field for my number values. When I try to do some calculation with that number values in the text field. Im having HUGE headaches.

First and most, the rules module doesnt allow calculation of numbers if they are not stored as number fields like Integer, Decimal or Float. Current stable release of Rules do not have an option for data type conversion. Im using a patch for the rules to be able to convert data types. Even with that patch and that conversion feature it is still an headache, since now I have to convert the number value in the text field to the decimal type to make some calculations. And when Im finish to the calculation, I want to assign the resulted value to another (or same) double field. But then again, I can not assign a decimal value to a text field, so I have to convert that back to text field type before assigning that value to the double field's text field.

I can not tell you how much it would ease this process if Double Field was able to support number fields like Integer, Decimal and Float. Well, Im not sure about the Float since Im only using Integer and Decimal myself.

I dont know how hard or how time consuming it is but adding these number field types will make me very very happy.

Thanks...

chi’s picture

Priority: Major » Normal
Status: Active » Closed (won't fix)

Rules module is based on Entity API. There are many other data types that rules support. See http://drupal.org/node/905580
I cannot introduce them to Double field because this module is too simple for such things.

guypaddock’s picture

Status: Closed (won't fix) » Active

Come on, now... the post wasn't about supporting everything that Rules supports. It's about supporting numeric fields -- Decimal, Float, and Integer -- as exposed by the "Number" module in 7.x core.

The text field is nice and all, but one of the use cases you mention is "units" -- specifying the units on a number. That use case isn't complete if the user can't actually use this module with a numeric field.

If you can't address this, at least leave this open for someone else to come by and patch.

chi’s picture

Title: "integer" or "decimal" field type support » 'Integer', 'Float' and 'Decimal' field types support
Assigned: Unassigned » chi
Category: feature » task
Status: Active » Needs work

I agree there's a need for this feature for some use cases. I am starting to work on this.

chi’s picture

Committed to 7.x-2.x.
There is still a lot of work to validate user input according to the size of the field and rework integration with some contributed modules. However, I think it is ready to use for the most use cases.

k.skarlatos’s picture

it works for me (but i have not tested it too much)

chi’s picture

Status: Needs work » Fixed

introduced in 2.3 release

pomliane’s picture

Excellent news, thank you Chi! :)

Status: Fixed » Closed (fixed)

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