Missing checks causing notices

Created on 10 August 2021, almost 3 years ago
Updated 29 January 2023, over 1 year 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.69.0 2024