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
Bug: I18n translation fails join after TreeBehavior->recover() #6794
Comments
You need to always add the exact version you are using, e.g. |
I edited my post :-) |
@Bl00per Are you adding containments through a beforeFind() callback? |
@ADmad nope! This table only has a beforeSave callback and some containments in the init |
I think it is reasonable to always add the table for the order statement in order for the query to not be ambiguous. |
Yes it is but I want to understand how the joins got into the query. Ideally that query should be done without any joins since they are not needed. |
@Bl00per "init" ? |
@ADmad aren't the joins generated by the I18n? And I ment there are belongsTo + hasMany functions in the initialize() within the table class |
Right, they are. I didn't ready the query carefully. I'll fix the ambiguity though for efficiency I would suggest you to detach the behavior before running recover(). |
Closing as PR is done. |
Both generated UnaryExpressions and OrderByExpression instances were not being quoted correctly by the identifier quoter. The `foo IS NULL` and `foo IS NOT NULL` expressions were missing identifier markers, while order by statements were also missing identifier quoting. Correctly quoting these query elements fixes errors in postgres related to TreeBehavior. Refs #6794
I use a I18n on my table.
But it throws a DB error after TreeBehavior->recover();
It says the following message: "Error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in order clause is ambiguous"
See the screenshot for more details.
How can I fix this?
cakeversion: 3.0.6
The text was updated successfully, but these errors were encountered: