PHP Warning: Undefined array key "link" in Drupal\decoupled_kit_breadcrumb\Controller\DefaultController->checkLinks()

Created on 26 September 2022, about 2 years ago
Updated 25 March 2023, over 1 year ago

Problem/Motivation

PHP throws a warning about an array index that does not exist.

Steps to reproduce

  1. Configure Decoupled Breadcrumbs at: /admin/config/decoupled_kit/breadcrumb/config to "Include title to breadcrumbs"
  2. Make `GET` request to /decoupled_kit/breadcrumb?path={/path-of-page/to-get-breadcrumbs-for}}

Proposed resolution

This warning is thrown because the checkLinks() function is trying to check for a link that doesn't exist when the aforementioned configuration is present. We ca Protect against this by checking for the key in the array first and setting the link to `null` if it does not exist.

Remaining tasks

- [ ] Merge merge request #1. _Pending_

πŸ› Bug report
Status

Fixed

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States z3cka

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024