Bug in field size #487
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#487
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Create a field in JCB, in the database tab, assign field size and then save the field. For example, simply create a Name field, give it VARCHAR (50) size and save the field.
Open the field again and you'll see that size information is not there i.e. JCB is not saving Size info.
Expected result
Field size information should be saved properly
Actual result
One Big issue is that when I'm creating the component, the same Field SIZE info is not copied to the SQL installation script and creating lots of troubles for me in installing the component. I've to manually edit the sql installation script to complete the component installation again and again.
System information (as much as possible)
Additional comments
I have also noticed this, when creating a new field the size value is dropped, I will take a closer look and get back with a fix.
Okay so it was fix in the last push to the staging branch, please test and let me know.
@jcodewalker just mentioned that this issue is not resolved.
@jcodewalker can you please give us more details of exactly what you are doing. Screenshot will be helpful. Since we do not see the same outcome.
Since you don’t see the same outcome I did go deep in the issue and I’ve discovered the trick.
To get the same result (at least it works for me), the field type (es: text) must not have a default database data settled. It means when you add a new text field, database data fields are not automatically populated but you have to do it manually. Then Save&Close, then open the new saved field and you should get the issue. If you set again the length and save it then it keeps the setting.
Even with”Fieldtype” I get the same issue when I set the database default data (first time), then once re-saved it keeps the setting.
Hope this helps
Okay, got it... I also now see the issue. Weird... still debugging not sure what is the cause.
ahaa found it, but wow it is a far larger issue then I thought.
Since it involves the actual JCB way of dealing with field conditions. See we have a common problem in web forms that if a field is required, it must both browser side and server side be required. Yet if the field is only required within the selection choices of other fields in the form we may hide the field at times and then it is not required. So bang... once you submit the browser could be told to allow this... and yet server side it would still complain.
There are two workarounds that are in use in the industry, first that you also have the same logic as the form in your validation class server-side that also based on active fields and selection maps required fields, and validates accordingly, second that you browser side build a second value set of field not required, that gets used server side to ignore fields. Well in Joomla the second option was the easiest way to implement, but with this option all not required fields must be emptied for security of course.
So now to this issue, the
datalenght
field gets added to this "not required" list, and therefore emptied an submission.So why is this a larger issue, well the actual problem is how JCB builds its field conditions with Javascript. Joomla as improved in this area since JCB was created, and so we need to instead start moving JCB into a more Joomla way of dealing with field conditions, instead of this huge load of Javascript.
I can fix this for this implementation in this view, but we will have to think head, and make the change in this whole area actually.
Yes, I understand.
Really it’s not a big deal for me, JCB doesn’t allow to save the field without a length, so we can survive with this until all the area is managed in a more Joomla way.
I just need to keep it in mind to avoid another issue call in Github in the future… :-)
Thanks, have a nice day!
This should at last be resolved, let me know.
Yes, fixed, I confirm.
Thanks!