-
-
Notifications
You must be signed in to change notification settings - Fork 180
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] Fix substitute binding type conversion #529
base: 1.8
Are you sure you want to change the base?
Conversation
Isn't this clearly a 404? I don't like that the library should just auto cast this. Seems wrong.. Do you have a more realistic scenario? |
@eigan I agree, that it should be 404, but it produces runtime type error on the database level with 500 error code, you can't handle this exception. In the example above, if client provides |
If a PK type is INT and a string is passed it really should be a 404 (possible model not found)? example uses is inputing a url for handwritten paper
vs |
@dpslwk oh, yeah, I see. |
yeah posible Its worth investigating how Laravel with eloquent handles this |
@dpslwk just reproduced that on eloquent and received the same result - 500. Eloquent doesn't handle this stuff |
@DemianShtepa I think for this behavior on level of routing pattern should be applied. To allow only number for the route. |
Doctrine documentation says, that PK can be either INT or STRING.
There is not any type conversion. Let's say we have some URL
/{document}/update
.If document has INT PK and we enter something like that
/1d/update
- we will catch an error from databaseERROR: invalid input syntax for type integer: \"1d\"
.This fix prevents type conversion errors.