Drupal Version

8.9.20

Domain module version

beta6

Expected Behavior

[What did you try to do? What URL did you use to do it?]
When we clear cache on UI then it should show the proper front page for respective domains. Of course, we are using domain site settings module to configure the front pages for each domain.

Actual Behavior

If we clear cache on UI then front page is showing Page Not Found
[What actually happened?]
Domain overrides the CID in domain/domain_config/src/Routing/DomainRouteProvider.php for cached route_matches.

One problem is, DomainRouteProvider uses the current request hostname in the CID. This will probably cause issues when using domain_alias, as you can not invalidate all route_matches in this case.

Another problem is, that this CID is not getting invalidated, not even on the same hostname as the one used as CID. The record still exists in "cache_data". (Deleting this record manually fixes the issue).

Steps to reproduce

  • Create two domains with country path module. For example: example.com/us and example.com/ca
  • Install and configure domain site settings module. Set different front page for both the domains.
  • Clear drupal cache in site(Use performance page, Dont use drush cr), access the front page of the both domains. You will see page not found

Issue fork domain-3266520

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

iyyappan.govind created an issue. See original summary.

iyyappan.govind’s picture

StatusFileSize
new3.29 KB

Patch

Brian-C made their first commit to this issue’s fork.

medusa43’s picture

StatusFileSize
new3.29 KB

Error persists in domain 2.0.0-beta1
Updated patch from #2 attached. Not thoroughly tested but seems to work again.

medusa43’s picture

Version: 8.x-1.0-beta6 » 2.0.0-beta1
dench0’s picture

StatusFileSize
new2.99 KB
dench0’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: 3266520-06.patch, failed testing. View results

idebr’s picture

Version: 2.0.0-beta1 » 2.0.x-dev
Status: Needs work » Needs review
StatusFileSize
new3.02 KB
new3.74 KB

Attached patch implements the following changes:

  1. Fix the PHP deprecation notices by injecting the domain negotiator as an optional dependency
  2. Use the addExtraCacheKeyPart method for forward compatibility with future changes in the RouteProvider
  3. Clean up docblocks

Status: Needs review » Needs work

The last submitted patch, 9: 3266520-9.patch, failed testing. View results

idebr’s picture