Configuration system.action.domain_access_none_action depends on the domain.record configuration that will not exist after import.

Created on 28 February 2025, about 2 months ago

Hello

When I import configuration, I get this error
Configuration system.action.domain_access_none_action depends on the domain.record configuration that will not exist after import.

here the content of system.action.domain_access_none_action

php vendor/drush/drush/drush.php cget system.action.domain_access_all_action
uuid: 7f6999ad-ede7-4aad-b46a-dd09b3262411
langcode: fr
status: true
dependencies:
  config:
    - domain.record.
  module:
    - domain_access
_core:
  default_config_hash: 1JWyzsu7w-WFCcw9q6gjKvOnNQweDxZxjQV8slWRIuI
id: domain_access_all_action
label: 'Assign content to all affiliates'
type: node
plugin: domain_access_all_action
configuration:
  domain_id: ''

I don't know how to resolve this error
I have to remove - config > - domain.record. ?

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium philalawst

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @philalawst
  • 🇮🇳India suraj3310 Punjab

    I was using drupal 11 and i got this same error on import configuration.

    1. What i did is i remove the dependency of domain.record from these config files.
    system.action.domain_access_all_action.yml
    system.action.domain_access_edit_all_action.yml
    system.action.domain_access_edit_none_action.yml
    system.action.domain_access_none_action.yml

    Then do the cim and it works.

    2. For new set up what i did is i add the not empty condition in calculateDependencies function in DomainAccessActionBase.php file.

    Below is the code

    Before :

    public function calculateDependencies() {
    if (isset($this->configuration['domain_id'])) {
    $prefix = $this->entityType->getConfigPrefix() . '.';
    $this->addDependency('config', $prefix . $this->configuration['domain_id']);
    }

    return $this->dependencies;
    }

    After :

    public function calculateDependencies() {
    if (isset($this->configuration['domain_id']) && !empty($this->configuration['domain_id'])) {
    $prefix = $this->entityType->getConfigPrefix() . '.';
    $this->addDependency('config', $prefix . $this->configuration['domain_id']);
    }

    return $this->dependencies;
    }

    Then i install the domain access module.

    It do not add dependency of domain record in system action configuration.

  • 🇺🇦Ukraine twilderan Kyiv, Ukraine 🇺🇦
  • 🇬🇧United Kingdom danharper

    I am also getting this error message.

  • First commit to issue fork.
  • Pipeline finished with Success
    27 days ago
    Total: 247s
    #451499
  • 🇺🇸United States froboy Chicago, IL

    @suraj3310 has the fix here, I just committed it.

    The issue is that when domain access is first installed, there are no domain records, and $this->configuration['domain_id'] is set, but is the empty string "", as that's what's set as the default value in the form.

    I'd recommend that once this change is released, the release notes contain the following:

    Prior versions could generate malformed configuration if config was exported before domain records were created. To fix, search for the following in system.action.domain_access* files and remove it, then re-import config:

      config:
        - domain.record.
    
  • 🇧🇪Belgium philalawst

    Thanks! I remove domain.record. and reimport config. That's work

  • First commit to issue fork.
Production build 0.71.5 2024