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.
Comments
Comment #2
dermarioComment #3
dermarioTested the patch in our local installation and it works fine. Code looks good for me too. Marking it as RTBC.
Comment #4
anybodyConfirming RTBC. !empty() could be used instead of isset() but that's a detail.
Comment #5
jsobiecki commentedHi, Im doing final review as part of Global Contribution Weekend.
Comment #6
jsobiecki commentedComment #8
jsobiecki commentedThanks all for contribution. I can confirm it works good. I decided to leave isset instead of empty.