-
Notifications
You must be signed in to change notification settings - Fork 108
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
Typecasting not advisable for Links #2015
Comments
@mvorisek Just an idea - wouldn't it be helpful if we could pass a parameter to HtmlTemplate to optionally make it render all variables with non-typecasted field values? For Links this would be highly recommended, as you rarely pass a typecasted field value in a URL parameter. |
also are special characters in URL (values) like |
@mvorisek Do you have any approach to solve this issue? Still I don't think we should render integers typecasted into URLs... |
if the above is true, the problem I described is more problematic but not so hard to fix :), and your issue should be (in theory, if it does not target other system) irrelevant, as the input should be typecasted with back correctly #1991 is draft PR to address bidirectional typecasting |
@mvorisek The more I think about it, the more I am convinced that the developer should still have a way to decide if an integer should be formatted or not. Suggestion: We introduce field type atk4_formatted_integer which will get thousandSeparator, wheres standard integer type not. It is too strict to format all integers, even if you just want money type to have thousandSeparator. |
Can you please share examples where unformatted integers should be used? I do not say they do not exist, but I am not fully convinced they are stronger. The machine readable data are not a good usecase, as they represent a different domain and different persistence must be used instead. URL - I agree machine readable format should be used. |
A product EAN barcode for example, a ticket number, a customer no., a serial number; |
To be able to search them using a barcode reader (which acts as keyboard)? Otherwise SN should have spaces for better UX. |
@mvorisek Any progress on the problematic handling of integer type being typecasted with thousandSeparator, even though the might be used for internal/system purposes? The current solution really is far from ideal in my opinion. |
I belive the problem (for links) comes from Line 146 in e0e9b34
So we need some machine persistence stored in App. Also review the Unit test must be added into https://github.com/atk4/ui/blob/develop/tests/TableColumnLinkTest.php. |
Steps to reproduce:
id
and you have thousandSeparator set to.
and an id like123.456
.The id is typecasted in the link, but it should not, $this is a grid:
Expected result: Open http://salesorderdoc.php?odaction=edit&odid=123456`
Current Result: Open http://salesorderdoc.php?odaction=edit&odid=123.456`
Otherwise
$app->stickyGet('odid')
will return a string which it should.The text was updated successfully, but these errors were encountered: