atk4 / ui

Robust and easy to use PHP Framework for Web Apps
https://atk4-ui.readthedocs.io
MIT License
440 stars 105 forks source link

TreeView not marking saved value #2021

Open mkrecek234 opened 1 year ago

mkrecek234 commented 1 year ago

Steps to reproduce:

Issue:

Expected behaviour:

This worked properly prior the latest develop commits

mvorisek commented 1 year ago

TreeView needs a Behat test to prevent breaking it in the future again.

mkrecek234 commented 1 year ago

Strange but working again without a change on Atk4 side as it seems, closing this issue

mvorisek commented 1 year ago

Thank you for the feedback.

mkrecek234 commented 1 year ago

I identified the issue which persists. Once again, it is a result of all id typecasting which is being done incorrectly, as an integer is passed to the vue component as a typecasted value with thousand separator. @mvorisek I believe we should think about getting rid of this, as $model->idField as integers normally should never be typecasted with thousandSeparators. ThousandSeparators is a UI topic ONLY and should ideally only affect displayed values to the customers, whereas any data layer below is not affected by that. @mvorisek

mkrecek234 commented 1 year ago

Also if I do not find the time yet to provide your requested behat tests, here is the essence of the issue after further analysis:

Consequence: TreeItemSelector requires a proper integer idfield, so current typecasting logic implemented will break this View if you have a thousandSeparator set. The only working workaround is #2022 , otherwise we have to change the logic how id fields are typecasted (or not) on hidden system fields in HTML.

mvorisek commented 1 year ago

About your 2nd point - why? please point to vue code, as ID can be a string like UUID or any other string.