Part 1
- login to Admin Console
- go to User Management → Users section
- reset all filters (if there are any)
- open Debugger
- confirm, that grid count query looks like this:
SELECT COUNT(*) AS count FROM 52x_Users WHERE ((52x_Users.UserType = 0)) LIMIT 0,1
Plan 2
- open \UsersEventHandler::SetCustomQuery method for editing
- revert any non-committed changes
- add $object->addFilter('testing_filter', 'img.DefaultImg = 0'); line after $object variable was initialized
- save changes
- login to Admin Console
- go to User Management → Users section
- reset all filters (if there are any)
- open Debugger
- confirm, that grid count query looks like this:
SELECT COUNT(*) AS count FROM 52x_Users LEFT JOIN 52x_CatalogImages img ON img.ResourceId = 52x_Users.ResourceId AND img.DefaultImg = 1 WHERE ((img.DefaultImg = 0) AND (52x_Users.UserType = 0)) LIMIT 0,1
Plan 3
- open \UsersEventHandler::SetCustomQuery method for editing
- revert any non-committed changes
- add $object->AddGroupByField('img.ImageId'); line after $object variable was initialized
- save changes
- login to Admin Console
- go to User Management → Users section
- reset all filters (if there are any)
- open Debugger
- confirm, that grid count query looks like this:
SELECT COUNT(*) AS count FROM 52x_Users LEFT JOIN 52x_CatalogImages img ON img.ResourceId = 52x_Users.ResourceId AND img.DefaultImg = 1 WHERE ((52x_Users.UserType = 0)) GROUP BY img.ImageId
v1.1
- changed SQLs in Part 2 and Part 3 to have (52x_Users.UserType = 0) in the WHERE clause