Drupal8::getUfId() - Fix exception on unknown usernames
authorTim Otten <totten@civicrm.org>
Tue, 21 Dec 2021 10:32:11 +0000 (02:32 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 21 Dec 2021 22:55:45 +0000 (14:55 -0800)
commit46a19be70eddce5cbe9766efff8a958e09f11c98
treeacc289d5eecb04427a5da724d9e0cbafbbb36efa
parente28cb6a2562762b6e678d30ed140a5f63d893e56
Drupal8::getUfId() - Fix exception on unknown usernames

As mentioned in https://github.com/civicrm/civicrm-core/pull/22239#issuecomment-997108926, there can be an exception:

```
Error: Call to a member function id() on bool in ...\CRM\Utils\System\Drupal8.php on line 359 #0 ...\ext\authx\Civi\Authx\Authenticator.php(380)
```

The function signature specifies `@return int|null`. Various callers appear to expect this, and that seems to be how it behaves on D7/WP.
CRM/Utils/System/Drupal8.php