Problem/Motivation

When adding the handler for the first time, the following error message is displayed: "Warning: Undefined array key 'password'".

Steps to reproduce

  1. Navigate to webform_id settings
  2. Select Emails / Handlers
  3. Add Handler

Proposed resolution

Mark the Settings "Password" field as mandatory and add a check to verify if the "password" key exists in the array before accessing it.

Remaining tasks

Prevent the warning from being triggered, for example

if (isset($array['password'])) {
    // Process password key
} else {
    // Handle missing key appropriately
}

or a similar function to ensure smoother handling of the required key.

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

sophron created an issue. See original summary.

kul.pratap’s picture

Assigned: Unassigned » kul.pratap

Working on it.

kul.pratap’s picture

Assigned: kul.pratap » Unassigned
Status: Active » Needs review

After changes, the warning is gone I have tested it on my site.
Please review.

shivam_tiwari’s picture

Status: Needs review » Reviewed & tested by the community

I faced this issue at the time of adding password protection handler. I got mentioned warning message on Drupal logs. Checked this issue and applied MR as a patch. This is worked for me without any error and warning.
Moving this issue to RTBC.

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

hoanglv’s picture

Status: Reviewed & tested by the community » Fixed
kul.pratap’s picture

@hoanglv I think you forgot to give the credit.

hoanglv’s picture

Status: Fixed » Closed (fixed)

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