Undefined array key "target_id" ajax error thrown when adding an Excluded override to a content and the same override was also added as a Promoted override in another content.

Created on 5 March 2025, 5 days ago

Problem/Motivation

Ajax error: "Undefined array key "target_id" in modules/contrib/search_overrides/src/Element/AddOverride.php on line 130" thrown when adding an override to the Excluded section in a node content and the same override was also added as a Promoted override in another node content.

Steps to reproduce

  1. Add an override (for e.g. dinner) as Promoted to a node
  2. Add the same override as Promoted to a second node
  3. Add the same override (for e.g. dinner) as Excluded to a third node
  4. Notice the above ajax error thrown in the web inspector console (Chrome browser)

Proposed resolution

There is a bug in the if-expression in file: search_overrides/src/Element/AddOverride.php Line 130
https://git.drupalcode.org/project/search_overrides/-/blame/2.1.x/src/El...
The expression should be:
if ($nid == $value['value']) {

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇮🇳India josedsilva Goa

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024