- Issue created by @jonhattan
- Merge request !69Issue #3512499: Add published/unpublished columns to Content Metrics/Grouped by type and language β (Merged) created by jonhattan
- First commit to issue fork.
- πͺπΈSpain lpeidro Madrid
I have to refactor how the database query is built. Using Aggregate Query and conditions is not working properly.
I tried adding a condition to the query, but I suddenly realized that it wasn't necessary. It was enough to simply add a new groupBy to the query.
This way, there is no need to run two queriesβone for published and another for unpublished content.
$query = $this->entityTypeManager ->getStorage('node') ->getAggregateQuery() ->accessCheck(FALSE) ->aggregate('nid', 'count', NULL, $alias_count) ->groupBy('type') ->groupBy('status');
$query = $this->entityTypeManager ->getStorage("node") ->getAggregateQuery() ->accessCheck(FALSE) ->aggregate('nid', 'COUNT', NULL, $alias_count) ->groupBy('langcode') ->groupBy('type') ->groupBy('status');
Jonathan please, could review the code.
Thanks a lot.
- πͺπΈSpain antonio.nunez Spain
The implemented solution adequately solves the reported problem. The code is well structured and meets the functionality requirements. Both columns work as expected and are displayed correctly in the view grouped by type and language.
- πͺπΈSpain lpeidro Madrid
I have merged the branch. Thank you Antonio and Jonathan.
-
lpeidro β
committed 64490597 on 1.x authored by
jonhattan β
Issue #3512499: Add published/unpublished columns to Content Metrics/...
-
lpeidro β
committed 64490597 on 1.x authored by
jonhattan β
Automatically closed - issue fixed for 2 weeks with no activity.