Domain 3.1.0 deprecated several APIs that this module uses (see change record 3583423 and #3588246):

  • DomainAccessManager static helpers are deprecated; use Drupal\domain_access\Utility\DomainAccessFields.
  • DomainNegotiator::setRequestDomain(), setActiveDomain(), negotiateActiveHostname(), isRegisteredDomain(), setHttpHost(), getHttpHost(), negotiateByPathPrefix() are deprecated. Push a Request onto request_stack and call DomainResolver::resolveDomain() (or DomainNegotiator::getActiveDomain(TRUE)) instead.

Findings

Production code:

  • domain_access_linkit/src/Plugin/Linkit/Matcher/AssignedDomainsNodeMatcher.php:33 - calls DomainAccessManager::getAccessValues(). Triggers a runtime deprecation notice.

Test code:

  • domain_access_linkit/tests/src/Kernel/AssignedDomainsNodeMatcherTest.php:147,167 - calls DomainNegotiator::setActiveDomain().
  • domain_config_entity_ui/tests/src/Kernel/DomainAwareConfigEntityStorageTest.php:239 - calls DomainNegotiator::setActiveDomain().
  • domain_sso_admin_toolbar/tests/src/Kernel/DomainSwitchControllerTest.php:116 - calls DomainNegotiator::setRequestDomain().

Proposed fix

  • Replace DomainAccessManager::getAccessValues() with DomainAccessFields::getAccessValues().
  • In tests, switch to pushing a Request onto request_stack and calling DomainResolver::resolveDomain() (or DomainNegotiator::getActiveDomain(TRUE)) per the migration guidance in the deprecation messages.
Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Two 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:

  • New deprecation: DomainConfigUIManager::getActiveDomainId() (deprecated in domain:3.1.0 via #3592832, removed in 4.0.0). Replaced with getActiveEditingDomainId() 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.
  • Moved helper: DomainConfigCollectionUtils::createDomainLanguageConfigCollectionName() moved to DomainLanguageConfigCollectionUtils (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.

  • mably committed d200020b on 3.x
    task: #3589272 Domain 3.1 API compatibility: replace deprecated...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.