Form Configurator Fields Positions

Hardus

Member
Hi,

I noticed a glitch while working in form configurator. Not sure if its a bug or something im not doing right.

Sometimes when choosing a field to edit from a table, it changes the position to 1 instead of the original position, sometimes it keeps the original position.

I then have to either re-set the positions of all fields to what I need them to be which is quite time consuming.

Is there any fix/way around this?

[pre]
You are using DaDaBIK version 9.1-Monterosso enterprise, installed on 10-17-2018 (installation code: 140855bc739c14ccd4), the latest version of DaDaBIK is 9.1-Monterosso released on 09-12-2018

You are runnning the last release of DaDaBIK

PHP Version: 7.2.10-0ubuntu0.18.04.1

mysql version: 5.7.24-0ubuntu0.18.04.1

Web server: Apache/2.4.29 (Ubuntu)

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36
[/pre]
 

eugenio

Administrator
Staff member
Hello,
I am not aware of this bug and I can't reproduce it; from what you say, it seems the field doesn't have, for some reason, an order position and therefore it gets the default one.
If your application publicly accessible? If yes, can you provide the steps to reproduce this issue?

Best,
 

Hardus

Member
Unfortunately its not publicly accessible, Just a minor annoyance, sometimes the same table when I previously edited the item and it worked previously. I unfortunately cannot reproduce the issue as its a random occurrence.

I thought it might be a bug. Its fine, Ill just continue like this.
 

eugenio

Administrator
Staff member
It is very strange, I would say it's impossible that the same field sometimes shows the correct value and sometimes doesn't, but please keep an eye on it and tell me if you can see any recurrent behaviour.

Best,
 

taubes

Member
Hi I have seen this happening also.
For me this happened when I changed the order of fields in the database and/or rename or delete fields. Then individual positions can get lost (basically you are missing a position number). Then anytime a field is edited this edited field is set to position 1.

There are two work arounds:
1) Find the gap in the positions list and fix starting from field 1.
or
2) Re-install the table (!! this was you loose the formatting), permissions can be saved for an identical or temporary table and then copied back

Hope this helps.

Stefan
 

eugenio

Administrator
Staff member
Hello Hardus and Stefan,
v. 9.2 doesn't contain a fix for this so if there is a bug, it is still there.

Can you provide a detailed example to reproduce the bug? Stefan when you say "delete fields" from the db, do you mean that you deleted the field in the db and then synchronized the dadabik app via DB Synchro -> step 2?

Thanks.
 

Hardus

Member
I havent gotten the issue since upgrading to 9.2. WIll let you know when I get it again. I have a lot of tables to setup now from scratch for my users.
 

Hardus

Member
Update on this. I Renamed a field in my one table in mysql and when I went to the db synchro in dadabik and added fields it said it added 4 new fields, the renamed field was also renamed correctly. After this the last 3 fields was renamed back to default names and all 3 had a field position of 1 including the 4th field which is the renamed field.

Hope this helps you identify the bug.
 

Hardus

Member
You are using DaDaBIK version 9.2-Monterosso enterprise, installed on 11-15-2018 (installation code: 140855bc739c14ccd4), the latest version of DaDaBIK is 9.2-Monterosso released on 11-07-2018

You are runnning the last release of DaDaBIK

PHP Version: 7.2.10-0ubuntu0.18.04.1

mysql version: 5.7.24-0ubuntu0.18.04.1

Web server: Apache/2.4.29 (Ubuntu)

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
 

eugenio

Administrator
Staff member
After having renamed the field, did you rename it in dadabik as well (db_synchro -> step 1) or you just added the fields (db_synchro -> step 3) ?
 

taubes

Member
Hi,

This bug is reproducible even without renaming. When you move a field in the database and then click "add fields" in "DB synchro" all positions in the "form configurator" downstream from the changed position in the database are set to 1.

In "choose a field" the fields are still presented in the right order but when you add a new field this is then shown in the first position and after that you cannot maintain the correct oder without renaming all the positions again.

You can reproduce this by creating a database with fields name1 name2 name3 and installing the table. When you then move name1 to the last position (after name3) and click on "add fields" in "DB synchro" name2 and name3 get position1 and and name1 gets the last position which is now position2. So you have position 3 missing and position 1 double. This gets pretty ugly when you have 30 fields in a table but can be manually fixed by adjusting the positions starting from 1.

Best

St
 

eugenio

Administrator
Staff member
Thanks, I will check it out.
Changing the order of the fields in the database (not in dadabik) is not a very common operation, when do you normally need it?

Best,
 

taubes

Member
Hi,

For me a great advantage of DaDaBIK is to develop a complex project with the ability to quickly add new features. For this my underlying database keeps evolving and I sometimes change field names to make things consistent with other tables. Because some tables have 30+ fields I try to have the same order of fields between similar tables.

Best

ST
 

Hardus

Member
Sorry for the late response.

Im still learning exactly how the staff needs the forms layed out. Every now and then I have either made an mistake or an field needs to be at a different position or new fields added to the middle or end etc, they also initially gave me wrong info then I need to change. Its a continuously evolving project. Im moving all excel sheets that multiple people is working on to dadabik, im at 21 Tables already and its growing each day.

eugenio said:
Thanks, I will check it out.
Changing the order of the fields in the database (not in dadabik) is not a very common operation, when do you normally need it?

Best,

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
 

taubes

Member
Hi Eugenio,

Still following this conversation ... Would be nice to have a fix for this. The order of fields in the database also affects the dadabik_users table. I guess the order of fields changed between older and newer dadabik versions (So Eugenio you are moving fields too :).

If dadabik was upgraded from an older version and you now sync the dadabik_users table it messes up the the formatting settings after the field of the position change. In this case the password entry script gets lost. This is prevented if the positions of the users table are matched with the positions dadabik expects before the sync.

This also relates to the request from Sorin: Can I extend the dadabik_users table with fields & FK ?

Best

Stefan
 

eugenio

Administrator
Staff member
Hello,

@Stefan
I'll start from the end: you can extend the users table starting from DaDaBIK 8.2, but only for fresh installations, see the changelog:

"The table dadabik_users was not ready to be extended so when, from DB synchro, new fields were added, the synchronization didn't work and the form configuration settings of the table were lost. Fixed. Now the schema of the dadabik_users table can be extended as any other table but this works only for fresh DaDaBIK installation, for DaDaBIK installations made with DaDaBIK v. <= 8.1 and then upgraded it doesn't work."

The issue related to database fields moved is currently in the todo list with low priority, I think that changing the order of the fields in the db schema is not a common operation (ok, I might have done it a few times in my life, I admit :) )

@Hardus
Not sure if this was clear: we are referring to the change (this seems to be the cause of the problem) of the position of a field in the DB table schema, not to the change of the position of a field in DaDaBIK.

Best,
 

eugenio

Administrator
Staff member
A comment to this old post just to say that the problem was actually bigger and it has been fixed in DaDaBIK 9.2.2.
Here is the relevant change log item:

If you changed the order of the fields in your database schema and then (without or without adding new fields to the table) you used the "Add Fields" function (DB Synchro), you lost your form configuration settings for one or more fields of the table. Fixed.

Best,
 
Top