-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 foreign query reference, use exists, realias sub-segment query, a… #6871
fix foreign query reference, use exists, realias sub-segment query, a… #6871
Conversation
…dd get alias function for leads table to query builder
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.
I have tested this PR with a segment that include segment filter in and notIn but now we have this error on some segments:
[2018-11-19 09:42:31] mautic.NOTICE: Mautic\LeadBundle\Segment\Query\QueryException: The given alias 'l' is not part of any FROM or JOIN clause table. The currently registered aliases are: ASKqQsTW, GUERVocT. (uncaught exception) at /app/bundles/LeadBundle/Segment/Query/QueryException.php line 37 while running console command mautic:segments:update [] []
@Enc3phale could you please paste full backtrace? |
@galvani of course:
|
Hi @galvani did you have the opportunity to look at it ? |
Hello @galvani any update on this ? |
Hi @galvani, in I found this lines
causing the error: If I remove lines no more error and segment is compiled, but I don't know if this could be removed. |
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.
Hi guys, we tried to work hard on it because we had some issues on segments. The conclusion is that this PR is creating more issues than solving. The root of the issue is coming from somewhere else.
In fact, the issue is: when you delete a segment which is included in another segment (with the filter "segment membership") then the deleted segment keep being saved in the filter of the other segment in the DB ---> that generates tones of issues.
This PR #6566 helps a lot to avoid future issues because you cannot delete a used segment but does not solve issues retroactively (you still need to re-do your old segments).
@npracht we should close it and refuse to merge this PR. I am not longer sure what it was made for. We don't have it in mautic-inc. It's too old. |
Fix segment foreign reference bug
Please be sure you are submitting this against the staging branch.
Description:
Segments with reference to another segment were not built correctly if grouped into condition using in and notIn. This PR fixes it and improves performance by replacing join with exists.
Steps to reproduce the bug and test this PR: