Skip to main content
added 199 characters in body
Source Link

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$value = 'some string';

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

EDIT: This actually does work as expected! My code included a do/while loop, which was the issue. Leaving the questions up in case someone else is searching for this or has a different solution.

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$value = 'some string';

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$value = 'some string';

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

EDIT: This actually does work as expected! My code included a do/while loop, which was the issue. Leaving the questions up in case someone else is searching for this or has a different solution.

Post Undeleted by Dario Zadro
Post Deleted by Dario Zadro
added 31 characters in body
Source Link

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$value = 'some string';

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$value = 'some string';

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

added 4 characters in body
Source Link

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of Users that match a custom field value?

Spent a good amount of time trying to return all Users that match a custom field value.

Reading the docs here, it shows a findAll() command.

However, when trying the code below, it's not working.

use craft\elements\User;

$users = User::findAll(['customField' => $value]);

return count($users);  

The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.

Any ideas how to get a count of all Users that match a custom field value?

Source Link
Loading