Problem/Motivation
When using country_path to allow domains to be split by a path prefix rather than independent domains domain_config_ui_path_is_registered uses the below code snippet which returns a raw path
$path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo();
This path includes the path prefix and results in the function always returning false (unless the domain specific paths are each individually added).
It is likely this does not only affect country_path hence why I'm raising this in this module.
country_path does account for this by processing and altering the path meaning
$path = \Drupal::service('path.current')->getPath();
returns the correct path.
Steps to reproduce
- Ensure a domain is configured with a path prefix as part of it's host using country_path
- Attempt to enable domain config for a config form while on this domain
- The path is added to the domain config ui configuration without the path prefix
- The config form added does not become domain specific due to the match occurring with the prefix
Proposed resolution
Utilise the path.current service for the config ui path match.
Remaining tasks
- Tests - TBC, not sure how feasible it is to create a test for this considering the issue is related to a secondary module. The new code does seem more reliable however so if we find another way of replicating a test can be created.
Issue fork domain-3184586
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:
- 3184586-domain-config-ui
changes, plain diff MR !1
Comments
Comment #3
alexj12 commentedComment #4
agentrickardThis seems reasonable. I wonder if this is also a problem with Multilingual paths, which might be easier to test?
Comment #6
agentrickardI have committed this as-is.