-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-10494: Refactored location filtering logic #682
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
base: 4.6
Are you sure you want to change the base?
Conversation
e083b65 to
f616985
Compare
f616985 to
8df9df8
Compare
| ): void { | ||
| /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause $sortClause */ | ||
| $queryBuilder->addOrderBy('content.modified', $sortClause->direction); | ||
| $queryBuilder->addOrderBy('content_modified', $sortClause->direction); |
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.
This is kind of unexpected if you got rid of the wrapped query. AFAIR this notation was used by the wrapped query, wasn't it? How does the SQL look like after the changes?
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.
SELECT DISTINCT
content.id AS content_id,
content.contentclass_id AS content_type_id,
content.current_version AS content_current_version,
content.initial_language_id AS content_initial_language_id,
content.language_mask AS content_language_mask,
content.modified AS content_modified,
content.name AS content_name,
content.owner_id AS content_owner_id,
content.published AS content_published,
content.remote_id AS content_remote_id,
content.section_id AS content_section_id,
content.status AS content_status,
content.is_hidden AS content_is_hidden,
version.id AS content_version_id,
version.version AS content_version_no,
version.creator_id AS content_version_creator_id,
version.created AS content_version_created,
version.modified AS content_version_modified,
version.status AS content_version_status,
version.language_mask AS content_version_language_mask,
version.initial_language_id AS content_version_initial_language_id,
main_location.main_node_id AS content_main_location_id,
ibexa_sort_location.is_invisible AS ibexa_filter_sort_location_visibility
FROM ezcontentobject content
INNER JOIN ezcontentobject_version version
ON (content.id = version.contentobject_id)
AND (content.current_version = version.version)
AND (version.status = 1)
LEFT JOIN ezcontentobject_tree main_location
ON (content.id = main_location.contentobject_id)
AND (main_location.main_node_id = main_location.node_id)
INNER JOIN ezcontentobject_tree ibexa_sort_location
ON (content.id = ibexa_sort_location.contentobject_id)
AND (ibexa_sort_location.node_id = ibexa_sort_location.main_node_id)
WHERE content.id IN (57)
ORDER BY ibexa_filter_sort_location_visibility DESC;
and
SELECT DISTINCT
content.id AS content_id,
content.contentclass_id AS content_type_id,
content.current_version AS content_current_version,
content.initial_language_id AS content_initial_language_id,
content.language_mask AS content_language_mask,
content.modified AS content_modified,
content.name AS content_name,
content.owner_id AS content_owner_id,
content.published AS content_published,
content.remote_id AS content_remote_id,
content.section_id AS content_section_id,
content.status AS content_status,
content.is_hidden AS content_is_hidden,
version.id AS content_version_id,
version.version AS content_version_no,
version.creator_id AS content_version_creator_id,
version.created AS content_version_created,
version.modified AS content_version_modified,
version.status AS content_version_status,
version.language_mask AS content_version_language_mask,
version.initial_language_id AS content_version_initial_language_id,
main_location.main_node_id AS content_main_location_id,
ibexa_sort_location.depth AS ibexa_filter_sort_location_depth
ON (content.id = version.contentobject_id)
AND (content.current_version = version.version)
AND (version.status = 1)
LEFT JOIN ezcontentobject_tree main_location
ON (content.id = main_location.contentobject_id)
AND (main_location.main_node_id = main_location.node_id)
INNER JOIN ezcontentobject_tree ibexa_sort_location
ON (content.id = ibexa_sort_location.contentobject_id)
AND (ibexa_sort_location.node_id = ibexa_sort_location.main_node_id)
INNER JOIN ezcontent_language language
ON language.id & version.language_mask = language.id
WHERE (content.id IN (63, 61))
AND ((language.locale IN ('eng-US', 'eng-GB', 'ger-DE')) OR (version.language_mask & 1 = 1))
ORDER BY ibexa_filter_sort_location_depth ASC;
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.
@mikadamczyk but that means that any custom sort clause will stop working because we've changed field name format from alias.field to alias_field, doesn't it? Which makes it a BC break.
konradoboza
left a comment
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.
Code looks good but please evaluate @alongosz remark. I guess we don't have other way to distinguish queries apart from location alias? The current one looks a bit hacky but can go as-is I guess.
tests/integration/Core/Repository/Filtering/ContentFilteringTest.php
Outdated
Show resolved
Hide resolved
...istence/Legacy/Filter/SortClauseQueryBuilder/Location/BaseLocationSortClauseQueryBuilder.php
Show resolved
Hide resolved
…mprove folder creation logic
|


Description:
getContentInfo()->getMainLocationId()everywhere.For QA:
Documentation: