So I did some more research into the issue and it looks like it's a bug on the Salesforce side. Now I can only theorize on why it's happening.
The UserType
field is a bit interesting it's a picklist that has labels and actual values according to the documentation.
Standard: user license. This user type also includes Salesforce
Platform and Salesforce Platform One user licenses. Label is
Standard.
PowerPartner: User whose access is limited because he or she is a
partner and typically accesses the application through a partner
portal or community. Label is Partner.
CSPLitePortal: user whose access is limited because he or she is an
organization's customer and accesses the application through
a Customer Portal or community. Label is High Volume Portal.
CustomerSuccess: user whose access is limited because he or she is an
organization's customer and accesses the application through a
Customer Portal. Label is Customer Portal User.
PowerCustomerSuccess: user whose access is limited because he or she
is an organization's customer and accesses the application through a
Customer Portal. Label is Customer Portal Manager.
CsnOnly: user whose access to the application is limited to Chatter.
This user type includes Chatter Free and Chatter moderator users.
Label is Chatter Free.
I've tested this on some of the Values with Labels. It appears when doing a Like on a SOQL search it only checks the label.
Some Examples:
SELECT
Id,
UserType
FROM user
WHERE UserType like '%Partner%'
Returns results back
SELECT
id,
userType
from
user
WHERE UserType like '%PowerCustomerSuccess%'
Returns no results back
SELECT
id,
userType
from
user
WHERE UserType like '%Customer Portal Manager%'
Returns results back
The above tests seems to confirm my suspicion.
LIKE
. That implies that UserType is not a normal picklist field. Whatever it actually is, SOQL doesn't treat it like a String.Sometext % moreText
in an SOQL returning results with a value ofSometext and noText
- I think there is something going on with SOQL wildcards because that value should not have been returned IMHO.