Skip to content
Snippets Groups Projects
Commit 9faa0682 authored by Salman Haider's avatar Salman Haider
Browse files

Issue #3363220: Publish and Unpublish column appearing 0 for Content

parent 0c719a8e
No related branches found
No related tags found
1 merge request!3Issue #3363220: Publish and Unpublish column appearing 0 for Content
......@@ -280,8 +280,10 @@ class EntityCountAnalyzerController extends ControllerBase {
*/
protected function getEntityCount($entityType, $bundle = NULL, $status = NULL) {
$query = $this->entityTypeManager->getStorage($entityType)->getQuery();
if ($bundle) {
$query->condition('vid', $bundle);
// Set the condition based on the entity type.
if ($bundle !== NULL) {
$conditionField = ($entityType === 'taxonomy_term') ? 'vid' : 'type';
$query->condition($conditionField, $bundle);
}
if ($status !== NULL) {
$query->condition('status', $status);
......@@ -289,5 +291,4 @@ class EntityCountAnalyzerController extends ControllerBase {
$query->accessCheck(FALSE);
return $query->count()->execute();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment