Domain 3.1.0 deprecated several APIs that this module uses (see change record 3583423 and #3588246):
DomainAccessManagerstatic helpers are deprecated; useDrupal\domain_access\Utility\DomainAccessFields.DomainNegotiator::setRequestDomain(),setActiveDomain(),negotiateActiveHostname(),isRegisteredDomain(),setHttpHost(),getHttpHost(),negotiateByPathPrefix()are deprecated. Push a Request onto request_stack and callDomainResolver::resolveDomain()(orDomainNegotiator::getActiveDomain(TRUE)) instead.
Findings
Production code:
domain_access_linkit/src/Plugin/Linkit/Matcher/AssignedDomainsNodeMatcher.php:33- callsDomainAccessManager::getAccessValues(). Triggers a runtime deprecation notice.
Test code:
domain_access_linkit/tests/src/Kernel/AssignedDomainsNodeMatcherTest.php:147,167- callsDomainNegotiator::setActiveDomain().domain_config_entity_ui/tests/src/Kernel/DomainAwareConfigEntityStorageTest.php:239- callsDomainNegotiator::setActiveDomain().domain_sso_admin_toolbar/tests/src/Kernel/DomainSwitchControllerTest.php:116- callsDomainNegotiator::setRequestDomain().
Proposed fix
- Replace
DomainAccessManager::getAccessValues()withDomainAccessFields::getAccessValues(). - In tests, switch to pushing a Request onto request_stack and calling
DomainResolver::resolveDomain()(orDomainNegotiator::getActiveDomain(TRUE)) per the migration guidance in the deprecation messages.
Issue fork domain_extras-3589272
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #4
mably commentedTwo more Domain 3.1.x incompatibilities surfaced in CI (PHPStan against drupal/domain 3.1.0-alpha4) after this issue was filed; both are now handled on the MR:
DomainConfigUIManager::getActiveDomainId()(deprecated in domain:3.1.0 via #3592832, removed in 4.0.0). Replaced withgetActiveEditingDomainId()at 6 sites in domain_config_entity_ui (storage trait, form_alter hook, param converter) and domain_maintenance (3 hook methods). That accessor returns the config-editing domain and falls back to the negotiated domain when no switcher is active, so behavior is preserved.DomainConfigCollectionUtils::createDomainLanguageConfigCollectionName()moved toDomainLanguageConfigCollectionUtils(namespace Drupal\domain_config_language\Config). Already updated in domain_config_extras, with the domain:domain_config_language dependency added.The MR also requires drupal/domain ^3.1.0-alpha4 so CI installs the release that ships the 3.1 APIs. With these, all 12 PHPStan errors against domain ^3.1 are resolved. Local checks: phpcs 0 errors, phpstan clear of the getActiveDomainId deprecation, kernel 14/61 and functional 6/75 green.
Comment #6
mably commented