• I followed your help topic on setting up currency fields and this worked very well until a big problem occurred.

    When I needed to make a change to a field, on updating fields, all the numeric values that I had so carefully changed in the PHPadmin, all reverted back to integer numeric. As i have quite a few currency fields and it is a long laborious task converting them all, as it is quite likely that I will need to make alterations to the database fields, is there possibly a way of creating a new decimal form element type?

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Yes, I’m sorry, changing the datatype on a database column can result in data loss, I tried to make that clear in the instructions. Creating a decimal field type wouldn’t prevent that, it’s just how mysql works.

    Thread Starter Karen Turner

    (@karen-turner)

    What happened was that I had made all the changes to decimal in phpmyadmin and added the step change to the numeric data field in the field group. I then put some data into the fields to check that it was working and all was good.

    Then I spotted I had not added a step::0.01 to one of the numeric fields, so I added it and updated the fields.

    All of the numeric fields for that field group then changed back to numeric BIGINT(20) in phpmyadmin. I suppose that is what they should do, as they are being updated back to the original numeric setting. But that means, you can not make any changes to the field group or click the update fields button, once you have completed the conversions to DECIMAL. Is that correct?

    Plugin Author xnau webdesign

    (@xnau)

    OK, I am very sorry about that. That should not have happened, when the field was updated, it changed the datatype. I did not realize that would happen, and I should have anticipated it when I wrote the tutorial.

    You’re right about the decimal field type, that would avoid the problem you ran in to.

    Thread Starter Karen Turner

    (@karen-turner)

    Thank you for your reply. Your plugin is excellent for the task we are building and I have set up quite a large multi page input form. But a few of the pages contain quite a few currency fields.

    As I am trying to develop the project, I know I will need to make changes to some of the fields in the field group at some point.

    Is there any chance that you will create a decimal field type for your plugin in the near future (10,2 would be excellent) or if not, is it something I could easily add, that would not be too much of a problem to implement each time you do a plugin update. If so, could you possibly point me to the files that I need to look at to make the changes.

    Thanks very much

    Plugin Author xnau webdesign

    (@xnau)

    I have a currency-type field coming in the next release, as well as safeguards to prevent what happened. That will be available in the next few days.

    Thread Starter Karen Turner

    (@karen-turner)

    That’s great. Thank you very much. And thanks for such an excellent plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Setting up currency fields’ is closed to new replies.