Issues with field "Auto-increment"

Post Reply
User avatar
rennecke
Sponsor
Sponsor
Posts: 214
Joined: 14 Jan 2018, 12:55
Name: Eberhard Rennecke
Location: Switzerland Zurich

Issues with field "Auto-increment"

Post by rennecke »

There are some issues with the field "Auto-increment" which I like to address:
  • The "Devault value" can not be set to 0 or negativ values. At lease 0 should be possible.
  • The setting for "Separate numbering for each parent record" conflicts with the setting "Unique Field". The check for unique value should be done for each parent record only if "Separate numbering for each parent record" is set. Othervise for the entire list.
  • Suggestion: Could it be possible to add a setting for the step of increment like fractions (0.1) or other (2 or 10 ...)?
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Issues with field "Auto-increment"

Post by support »

1) yes, it's not supported at the moment, I'm not sure I want to add it.
2) yes, it's conflicted, but this is not bug I think.
3) suggestion is added in plan.
User avatar
rennecke
Sponsor
Sponsor
Posts: 214
Joined: 14 Jan 2018, 12:55
Name: Eberhard Rennecke
Location: Switzerland Zurich

Re: Issues with field "Auto-increment"

Post by rennecke »

1) even not 0 as default? Why are yuo nit sure to add it?
2) OK, might be not a bug, but it could be good, being able to configure either or
3) thanks
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Issues with field "Auto-increment"

Post by support »

Updated this field type and now you can:
1) You can set Default value as 0
2) You can configure Step (can be positive or negative or float)
3) With option " View Only" there will be double check for unique value before save.

You can try it before release 2.8. File from archive replace to includes\classes\fieldstypes\
And in includes/languages/english.php add next line

Code: Select all

define('TEXT_STEP','Step');
Let me know if everything works ok.
Attachments
screenshot-localhost-2020.10.30-06_20_01.png
fieldtype_auto_increment.zip
(1.86 KiB) Downloaded 130 times
User avatar
rennecke
Sponsor
Sponsor
Posts: 214
Joined: 14 Jan 2018, 12:55
Name: Eberhard Rennecke
Location: Switzerland Zurich

Re: Issues with field "Auto-increment"

Post by rennecke »

Dear Sergey.
Many thanks for that update. I tested it with an allready used entity. In that entity I had several records from 1001 to 2810. The default value was set to 1000. I left it as it was.
1. I tried a negativ step value of -1. I expected to get 2809 causing an error as 2809 is already used. But I got 1000. With the next I got 999. This is fine, as with negativ steps the field looks for the lowest available value and pulls off the step.
2. I changed back to a positiv value of 5 and I got 2815. So, this works well.
3. I used to different browser with two different users and started adding a record with one and before saving this record I started to add a record with the other user. Finished this first (I got 2820 = OK). Finishing the first I got 2825. In the past I got 2820 too, which was wrong.

So, all my expectations are fulfilled with your update. Many thanks.
Best Regards Eberhard
Post Reply