Number data losing leading zeroes #125

Closed
opened 2017-09-23 17:58:41 +00:00 by alexsykes · 3 comments
alexsykes commented 2017-09-23 17:58:41 +00:00 (Migrated from github.com)

Hi Llewellyn, I'm gradually working through the videos and getting used to the basics of JCB. It is a very time-saving piece of kit.
One issue that I have noticed is that when I do a dump, compile, download, uninstall, reinstall update routine, any fields containing numbers only with a leading zero - such as telephone numbers - lose the leading zero when reinstalled. Looking at the install.sql file, these data are not 'ticked' so, I guess when read in are treated as number values.
Any thoughts?

Hi Llewellyn, I'm gradually working through the videos and getting used to the basics of JCB. It is a very time-saving piece of kit. One issue that I have noticed is that when I do a dump, compile, download, uninstall, reinstall update routine, any fields containing numbers only with a leading zero - such as telephone numbers - lose the leading zero when reinstalled. Looking at the install.sql file, these data are not 'ticked' so, I guess when read in are treated as number values. Any thoughts?

Hi, The code that builds the dump is found in the get.php of the compiler on line 2797
now to actual method we need to improve is found on line 2951

You are welcome to make a pull request, or just dump some code in this issue that you think could resolve the issue.

Hi, The code that builds the dump is found in the [get.php of the compiler on line 2797 ](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/a_Get.php#L2797) now to actual method we need to improve is found on line [2951](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/compiler/a_Get.php#L2951) You are welcome to make a pull request, or just dump some code in this issue that you think could resolve the issue.

We could add a option that if it detects the first value to be zero that it treat it as a string... something like this..

if (mb_substr($value, 0, 1, 'utf-8') === '0') { // needs string treatment }

IF you have no better idea, we can add this to the core.

We could add a option that if it detects the first value to be zero that it treat it as a string... something like this.. ``` if (mb_substr($value, 0, 1, 'utf-8') === '0') { // needs string treatment } ``` IF you have no better idea, we can add this to the core.
alexsykes commented 2017-10-08 18:21:44 +00:00 (Migrated from github.com)

Thanks. Appreciated.

Thanks. Appreciated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#125