Hi,

I accidentally removed an email I got today about this, and I do not recall who send it to me, so I cannot reply to this person. I'm sorry about that, and I hope you can see this feature request, so you can chime in if necessary.

The idea was to change a few bits of the current implementation of this module to make it easy to use Formatted Numbers at FormAPI level. Nice.

Well, I believe it is currently impossible because: a) dependency on content_field() and b) the FAPI element needs to be constructed with all the stuff that CCK puts in place.

To use Formatted Numbers at FormAPI level, we would have to move all code dependent on CCK to formatted_number_widget() and keep FAPI dependent code as agnostic as possible. This includes formatted_number_elements(), formatted_number_widget_process() and probably the field formatters (theme functions).

Unfortunately, I do not have time right now to work this out, so I'll keep this feature request as postponed until I can find a hole, or someone else can come up with a patch, which is more than welcome.

Comments

markus_petrux’s picture

Project: Format Number API » Formatted Number
markus_petrux’s picture

Project: Formatted Number » Format Number API
Status: Postponed » Active

I do not know why I switched the project, but this feature should be implemented by Format Number API. We need a 'numeric' form element, not within the scope of CCK, which is what Formatted Number CCK solves, so I'm going to work on this...

I guess I need to take over a new name for a FAPI element... note that 'formatted_number' is taken by the CCK related module, and I do not want to enforce more version dependencies between both modules, so I need to use a different name for the FAPI element, however 'number' is also taken by the CCK Number field (CCK2 and Fields in D7), so I need something different... 'numeric' maybe? hmm... it looks good, and it seems to me no one else is using this name. ¿?

Related discussion at g.d.o: http://groups.drupal.org/node/37522

markus_petrux’s picture

Title: Formatted Number at FormAPI level » Implement numeric input element at Forms API level

Better title, and patch coming...

markus_petrux’s picture

Status: Active » Fixed
markus_petrux’s picture

Status: Fixed » Needs work

Ugh... this is not ready yet. Numbers with decimals are not properly formatted in FAPI stuff. Will look into it as soon as possible.

markus_petrux’s picture

Status: Needs work » Fixed

Well, I think it is now done. I have committed to CVS a fix for our element process and value callbacks.

http://drupal.org/cvs?commit=296174

markus_petrux’s picture

Yet another follow up to fix the logic behind the #size and #maxlength attributes of the input element.

http://drupal.org/cvs?commit=296182

Status: Fixed » Closed (fixed)

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