Try to copycat core code as much as possible.

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
lincoln-batsirayi’s picture

@mably I've tested this, it seems to be working well but i do get this error whilst editing content from time to time

Error: Class "Drupal\Core\Database\Statement\FetchAs" not found in Drupal\domain_path\DomainAliasRepository->preloadPathAlias() (line 58 of modules/contrib/domain_path/src/DomainAliasRepository.php).
Drupal\domain_path\DomainPathAliasManager->getDomainAliasByPath('/admin/config/search/path/patterns', 'sandbox_ddev_site', 'en') (Line: 154)
Drupal\domain_path\DomainPathAliasManager->getAliasByPath('/admin/config/search/path/patterns', NULL) (Line: 47)

And i can only get rid of it by clearing the cache (but it does come back), so i updated the code snippet from:
$results = $select->execute()->fetchAll(FetchAs::Associative);

to

$results = $select->execute()->fetchAll(\PDO::FETCH_ASSOC);

Based what other core and contrib modules are doing and it fixed the error completely, so if you update the MR to fix that i think it should be good to go in my opinion.

mably’s picture

Looks like it's related to this issue:

#3487851: Replace \PDO::FETCH_* constants to indicate fetch mode with an enumeration

So Drupal 11+ only.

  • mably committed 55cdaaa0 on 2.x
    feat: #3563785 Refactor to use a DomainAliasRepository similar to Core...
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.