8.5.2 UserList Issues

Permalink
I apologize in advance if this is a a stupid question and for the long post. I've looked carefully at the documentation and I am struggling with the UserList.

I'm attempting to look up a user by a custom attribute. This is what i have so far

I'm injecting the UserList class
protected $userList;
    public function __construct(UserList $userList) {
        $this->userList = $userList;
    }


Then using it like this:

$this->userList->ignorePermissions();
        $this->userList->includeUnvalidatedUsers();
        $this->userList->filterByAttribute('mindbody_account_id', $clientId, '=');
        $users = $this->userList->getResults();


The error is:

Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing 'SELECT u.uID FROM Users u LEFT JOIN UserSearchIndexAttributes ua ON u.uID = ua.uID WHERE (ak_mindbody_account_id = ?) AND (u.uIsActive = ?) GROUP BY u.uID' with params ["100000009", true]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_mindbody_account_id' in 'where clause' in file /home/vegaxzfd/vegadev.vegadancelab.tv/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 71

I added the attribute through the standard UI. It's currently set as a number field and I verified the attribute handle is "mindbody_account_id"

It looks like the code is expecting a column in the "UserSearchIndexAttributes" table so I attempted to set the attribute as indexable and searchable and I kicked off the job to rebuild the index. I even tried to rebuild entities. No dice.

I am new to Concrete5 so I know I am just missing something simple :)

Thank you for any help you can give!

View Replies:
Korvin replied on at Permalink Reply
Korvin
Make sure you have that attribute listed as indexed and searchable.