Missing checks causing notices

Created on 10 August 2021, over 3 years ago
Updated 29 January 2023, almost 2 years ago

Problem/Motivation

When certain values like 'below' are not set notices are thrown.
- Notice: Undefined index: below in translatable_menu_link_uri_iterate_menu()
- Notice: Undefined index: original_link in translatable_menu_link_uri_iterate_menu()
- Notice: Undefined variable: plugin_id in translatable_menu_link_uri_iterate_menu

Steps to reproduce

Create menu items without a sublevel.

Not having any items below the first will generate the first notice.
Original link can be empty so that can throw a notive.
If that happens $plugin_id is never set and has no default value which will throw another notice.

Proposed resolution

Perform checks and provide a default value where necessary.

I have attached a patch for this.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇱Netherlands thomasdik

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