Problem/Motivation
If some modules don't exist (ie. simplenews), this notice appears in the "Add policy" page.
Notice: Undefined index: label in Drupal\symfony_mailer\Form\PolicyAddForm->form() (line 21 of modules/contrib/symfony_mailer/src/Form/PolicyAddForm.php)
Issue fork symfony_mailer-3254102
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
Comment #3
balis_m commentedComment #4
adamps commentedGreat thanks for the report.
That fix works, however I prefer a different approach. We don't want all code ever written that calls
$emailBuilderManager->getDefinitions()to have to exclude the invalid ones. If the module doesn't exist, it would be better if the definition was automatically deleted.I believe we can achieve this by adding code in EmailBuilderManager. At the top of this function we could add
$definition['provider'] = '_';. This should causeDefaultPluginManager::findDefinitions()to decide that the provider doesn't exist and remove the definition. This idea comes from reading the code - I haven't tested it yet.Comment #5
balis_m commented@AdamPS I agree that the approach you suggested is better and also works.
Comment #6
adamps commentedGreat thanks. That line is a bit mysterious so please can we add a comment something like this?
// Set a dummy provider that will cause the definition to be removed.
// @see DefaultPluginManager::findDefinitions()
Comment #7
balis_m commented@AdamPs I've added the suggested comment.
Comment #8
adamps commentedGreat thanks