Closed (fixed)
Project:
Format Number API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2011 at 11:54 UTC
Updated:
13 Feb 2012 at 06:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
parka commentedIt will be great if there's a release for D7
Comment #2
lloydpearsoniv commented+1
Comment #3
yannisc commented+1
Comment #4
SQP commentedHere's a first version of the drupal 7 port of the module.
As I didn't played enough with the new fields api, I only ported the core part of the module : the format_number function and the admin + user configuration.
Global config is available at admin/config/regional/format_number
I use it for 2 weeks on my development site without any issues.
Hope it will already help some people.
(the part that still need work start at hook_elements in module file)
Comment #5
Anonymous (not verified) commentedHi SQP,
I'm trying to install the patch with git, I tried several commands, but I'm unable to get it to work. Could you please tell me what's the correct command line I should use.
I tried git on version 6.x-1.6 and 6.x-1.x-dev and it didn't work.
Help is really appreciated.
Thanks!
Comment #6
sylvanos commentedsame problem here
Comment #7
SQP commentedHi, thanks for your test. Could you try with those commands
Seem to patch well, but didn't retested it yet.
Comment #8
sylvanos commentedThanks, the installation went well for me. Probably me not knowing how the module works, but I've set the Thousands separator to comma (,) and i still can't write a number like 1,200 in a numerical field. Drupal still tells me that only numbers may be written in those fields.
Comment #9
Anonymous (not verified) commentedThanks! the installation went well for me as well! ^_^
Comment #10
trampjuice commentedFantastic - missed this since upgrading to drupal 7. But after applying the patch as per above i get this;
Warning: Missing argument 4 for format_number_numericfield_process(), called in C:\xampp\htdocs\evictionsfrom10pounds.com\includes\form.inc on line 1748 and defined in format_number_numericfield_process() (line 422 of C:\xampp\htdocs\hhh.com\sites\all\modules\format_number\format_number.module).
when doing this on a form
$form['my_number'] = array(
'#type' => 'numericfield',
'#title' => t('My number'),
'#precision' => 10,
'#decimals' => 2,
'#minimum' => 0,
'#maximum' => 123456.99,
'#default_value' => 0,
);
Comment #11
jonathan_hunt commentedFWIW, I migrated my formatted_number fields to D7 number fields by altering the database then using the CCK Content Migration in Drupal 7.
e.g. (substitute your fieldname in the queries below)
Comment #12
Shadlington commentedSubbing
Comment #13
jeevajothi commentedI installed D7 but i dont' know how to do above work. in which software i have to do it...i need step by step.anybody can please send me..
Comment #14
jeevajothi commentedwget not found error in my git.
please help to install format_number api in d7
Comment #15
basicmagic.net commentedsubscribe
Comment #16
pepemty commentedsubscribing
Comment #17
tinker commentedThanks @SQP for doing the first conversion to D7. I had the following issues when adding a numericfield form element.
Today is the first time I looked at the new D7 hooks so I welcome a thorough review of my code changes as I may have done something wrong. Saying that everything does appear to be working without errors. I have attached a cumulative patch that can be applied to 6.x-1.x-dev branch source.
Perhaps a committer could open a 7.x-1.x-dev branch so we could appropriately add issues? I would be happy to co maintain the 7.x branch.
I am hoping to use this module as a first wave into extending Drupal's multilingual support of non textual data. The first step would be to add number formats settings per locale [language/country]. See #1345758: META: Provide locale (regional) formats framework for automated translation of non textual data
Comment #18
markus_petrux commented@tinker: I may not have enough time to review/apply patches here. If you wish, I would be glad to grant co-maintainer access to Format Number API (and maybe Formatted Number CCK) to you or someone else involved in #1345758: META: Provide locale (regional) formats framework for automated translation of non textual data .
Comment #19
excel86 commentedI tried applying the patches to 6.x-1.x-dev, but it came back with errors. I would greatly appreciate it if there is a release for D7. Thank you very much.
Comment #20
tinker commented@markus_petrux, I would be happy to maintain a 7.x-0.x-dev branch so please add me. Do you think GIT only access until somewhat stable?
@excel86, Did you apply just the patch from #17? It is cumulative and includes all changes from #4. Applying both will cause errors. Perhaps you could share the error messages?
Comment #21
markus_petrux commented@tinker: I have given you access to GIT, but also to project page and releases, just in case. If you also need access to Formatted Number CCK, just ask. Thanks!
I have also contacted cweagans, who recently asked for co-maintainership access to these projects, in case he's been working in the D7 ports, or just to let him know.
PS: Adjusting issue attributes. @excel86: I think 'critical' priority is related to bugs, things that are 'broken'.
Comment #22
excel86 commented@tinker, thanks a lot for helping to develop the D7 version, it will be extremely helpful for me. I am still new to all this, so I had some difficulty applying the patches. I did just try to apply the patch from #17 (not #4) but it didn't work for me. I had applied the patch following the above instructions to the 6.x-1.x-dev files which I had saved to my C: drive, then tried to upload that to my Drupal site. Would it work that way?
@markus_petrux, thanks for letting me know that, i'm still new to all this, so my apologies there.
Comment #23
erkiha commentedthis patch works perfectly for me. Thank you very much. Is there a patched version of this module available somewhere to make the maintenance easier?
Comment #24
markus_petrux commented@erkiha & all: Thanks a lot for testing and confirming.
@SQP, tinker: Thank you very much for the job.
I have commit a slight variation of the patch in #17:
- http://drupalcode.org/project/format_number.git/commit/e52ee8a46466f4aa7...
I have also created a new dev release for the D7 branch, tha should be available as soon as the Drupal package is built (I think that happens twice a day).
- http://drupal.org/node/1419952
Please, open separate tickets to the D7 for each issue that may still be there. Thanks!
Comment #25
erkiha commentedhm, d7 branch does not work at all. I.e. settings appear but when I use numericfield in my custom form, it does not show that fied. Reverted back to patch #17. Is there anything different which I should take into account?
Comment #26
markus_petrux commentedOpps, I applied the patch manually, because I wanted to avail the oportunity to practice D6->D7 ports, and forgot to apply one little change in the .module script. Try the following:
Change to file format_number.module
Anyway, I have just fixed a couple more issues (coder warnings), and it might be better to wait for the next dev snapshot, which is already visible from the project page.
Apologies for the noise.
Comment #27
erkiha commentedNow it works OK, thank you.