Problem/Motivation

Sometimes encountering the following error:
Warning: Undefined array key "id" in Drupal\domain_source\Plugin\Action\DomainSourceActionBase->buildConfigurationForm() (line 73 of modules/contrib/domain/domain_source/src/Plugin/Action/DomainSourceActionBase.php).

Steps to reproduce

Happens for me when opening the ECA Modeler.

Proposed resolution

Looks to me like the '#default_value' => $this->configuration['id'], in \Drupal\domain_source\Plugin\Action\DomainSourceActionBase::buildConfigurationForm() should be
'#default_value' => $this->configuration['domain_id'],

Remaining tasks

  1. ✓ Patch
  2. Review
  3. Merge

User interface changes

None

API changes

None

Data model changes

Issue fork domain-3604163

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

das-peter created an issue. See original summary.

das-peter’s picture

Assigned: das-peter » Unassigned
Issue summary: View changes
Status: Active » Needs review

mably made their first commit to this issue’s fork.

mably’s picture

Thanks @das-peter for reporting this and providing the fix.

I pushed a kernel test to the MR branch covering it: DomainSourceActionFormTest builds the domain_source_set_action configuration form with a saved domain_id and asserts the Domain checkboxes default to it.

Verified both ways: on the current code (reading the id key) it fails with an "Undefined array key" warning and the default comes back as null; with the fix in place it passes. It is the first coverage of these action configuration forms, so it guards against the regression returning.

  • mably committed b5d25299 on 3.x authored by das-peter
    fix: #3604163 Undefined array key "id" in Drupal\domain_source\Plugin\...
mably’s picture

Status: Needs review » Fixed

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.

  • mably committed 60a202dd on 3.0.x authored by das-peter
    fix: #3604163 Undefined array key "id" in Drupal\domain_source\Plugin\...

Status: Fixed » Closed (fixed)

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