Problem/Motivation

I'm using Symfony Mailer v2.0.1 and just installed the mailer_policy submodule which created a new config/sync/mailer_policy.mailer_policy._.yml which I loaded and saved the form without changing, and resulted in a config entity which has the following:

uuid: ...
langcode: en
status: true
dependencies:
  module:
    - _
_core:
  default_config_hash: ...
id: _
configuration:
  mailer_inline_css: {  }
  email_theme:
    theme: _active_fallback
  mailer_url_to_absolute: {  }
  mailer_wrap_and_convert:
    plain: false

Now all my config:import commands are blocked because of the dependencies line. Error message:

Configuration mailer_policy.mailer_policy._ depends on the _ module that will not be installed after import.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

dave reid created an issue. See original summary.

adamps’s picture

It works fine for me but I don't use config syncing.

The config file is fine config/sync/mailer_policy.mailer_policy._.yml is correct in the codebase, without any dependencies. So I don't know where the problem dependency comes from.

dave reid’s picture

If you inspect the config entity in the database after saving in the UI, you'll also see it's been changed. Is the third part in the filename supposed to be a module name for the other policy configs?

adamps’s picture

If you inspect the config entity in the database after saving in the UI, you'll also see it's been changed

Thanks now I see the bug. MR coming up.

Is the third part in the filename supposed to be a module name for the other policy configs?

Correct. There is code to declare a dependency based on this part of the name. We need to block it in the case of the '_' policy, in MailerPolicy::fillDummy().

I fixed a second bug that this dependency was missing on many config entries, in MailerLookup::checkSubDef().

The final change in MailerLookup::processDefinition() is just a tidy up

adamps’s picture

Title: Configuration mailer_policy.mailer_policy._ depends on the _ module that will not be installed after import. » Incorrect depedencies in mailer policy config entires
Issue summary: View changes

adamps’s picture

Status: Active » Needs review

Possibly we should also have an update hook to correct all existing saved config.

  • adamps committed bbda08be on 2.x
    fix: #3592086 Incorrect depedencies in mailer policy config entires
    
adamps’s picture

Status: Needs review » Fixed

@dave reid please can you confirm this fixes it for you?

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.

dave reid’s picture

I have attempted the fix and it fixes it for the default or no-provider plugins, but I did create a new policy with id user.status_activated and it did not create a dependency on the user module. Should that be expected?

dave reid’s picture

Nevermind, I think I was just needing to use the Overrides module for those properly with a provider. Yes, I consider this resolved. +1 for a new release.

theodorosploumis’s picture

Title: Incorrect depedencies in mailer policy config entires » Incorrect dependencies in mailer policy config entities

Minor, fix title of the issue

Status: Fixed » Closed (fixed)

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