Painless fieldtype change of a field. #657

Closed
opened 2021-01-23 17:19:15 +00:00 by mfleeson · 3 comments
mfleeson commented 2021-01-23 17:19:15 +00:00 (Migrated from github.com)

Steps to reproduce the issue

Create a field as text, set a field name, a label and a description.
Decide to change from text to List and all existing fields get reset, field name becomes list, name becomes mylist, description get's emptied.

Expected result

Additional fields to be added such as class=list_class, option=0|Option 1 etc

Actual result

All fields get reset

System information (as much as possible)

  • OS Name & Version: Centos 7
  • MySql Version: 8.0.22
  • Apache Version: 2.4.6
  • PHP Version: 7.3.26
  • Joomla Version: 3.9.24
  • JCB Version: 2.12.5
  • Browser: Firefox

Additional comments

Looking at the source, the only reference to mylist which is what the field name gets changed to is in an sql query. It looks like changing the field type just overwrites all of the fields with default one's from the database. Would it be possible to only update fields that haven't been changed?

### Steps to reproduce the issue Create a field as text, set a field name, a label and a description. Decide to change from text to List and all existing fields get reset, field name becomes list, name becomes mylist, description get's emptied. ### Expected result Additional fields to be added such as class=list_class, option=0|Option 1 etc ### Actual result All fields get reset ### System information (as much as possible) - OS Name & Version: Centos 7 - MySql Version: 8.0.22 - Apache Version: 2.4.6 - PHP Version: 7.3.26 - Joomla Version: 3.9.24 - JCB Version: 2.12.5 - Browser: Firefox ### Additional comments Looking at the source, the only reference to mylist which is what the field name gets changed to is in an sql query. It looks like changing the field type just overwrites all of the fields with default one's from the database. Would it be possible to only update fields that haven't been changed?

Sorry that is currently the normal behavior. The way this area works it basically rebuilds the whole sub-from each time you change the field_type.

I can understand that is a pain if you don't know that... and I can understand that it would be great to at least try to carry the current data across. So we could add this to a feature request and start looking at the path.

This is a fully ajax driven area, and yes what we do is absolutely crazy (once you see how it works). But if you know the history of JCB then you will understand why the way I build this area was needed... I tried to keep backward compatibility while moving forward to better GUI.

Sorry that is currently the normal behavior. The way this area works it basically rebuilds the whole sub-from each time you change the field_type. I can understand that is a pain if you don't know that... and I can understand that it would be great to at least try to carry the current data across. So we could add this to a feature request and start looking at the path. This is a fully ajax driven area, and yes what we do is absolutely crazy (once you see how it works). But if you know the history of JCB then you will understand why the way I build this area was needed... I tried to keep backward compatibility while moving forward to better GUI.

We are closing this, until we get to code it then we will open this back up.

We are closing this, until we get to code it then we will open this back up.

I added the code to fix this... please test if you can...

I added the code to fix this... please test if you can...
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#657
No description provided.