-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typecasting for TreeView #2022
Conversation
Fix above works for single value treeItem correctly, however for multiple-value item the typecastLoadField does not support json yet. @mvorisek Can you check please? The sample with multiple-value is not working anymore:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be right. You cannot mix load/save typecasting direction.
And as posted originally, I would like to have this tested by Behat. Not only to prevent it into the future, but as not tested, it was not fixed yet nor with #1991.
Has to be typecastLoadField and not save which was wrong in the original code. However, the |
"load" direction is almost surely wrong, as "load" direction implies a value to be loaded from an input, which is probably not the case here |
Valid point - the key solution has to be that scalar values shall not be typecasted (see latest commit), as the Vue component cannot handle ids with thousandSeparator. Still typecasting for non-scalars. Working and tested now in live setup and demos, sorry behat test has to be provided by another contributor |
Still the fix is wrong, the ID can be internally stored as any type - see #1991 prooving this case - ID wrapped in an object. |
Would appreciate to see your improved code proposal - the current implementation in develop branch is definitely wrong, and also not working in a defined setup |
The main question is why is the typecast an issue. Any fix of |
The Vue TreeItemSelector does not support an Input field value which has thousandSeparator, so ID = 1.750 will not work, even though Atk4 saves and loads it properly. The input field thus has to have a non-typecasted ID inside, otherwise TreeViewItemSelector will not mark the correct item as active. |
The main reason for the above issue is simply that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please understand the solution you provided cannot work with #1991, ie. the fix is still not correct, there is no reason to handle scalars differently as long as there are not handled differently on reverse typecasting - they are not and never will be.
The correct way to fix this problem is to:
a) provide minimalistic test cases - basic, and if not needed, for edge cases too
b) verify the visible data/integers/datatimes (objects) are typecasted correctly
c) verify all cases/save etc. are fixed properly
d) verify the TreeView coverage has increased (open CodeCov and check uncovered lines, regular scenarios must be covered)
Let's start with a failing test. |
Solves issue #2021