No warning shown for undefined title callback function

Created on 6 July 2011, over 13 years ago
Updated 19 April 2024, 6 months ago

There is no warning shown when the title callback function for a hook_menu() item is undefined. Instead, Drupal displays a blank title. I expected a PHP warning message, as is the case the page callback function is undefined.

It appears that changing the following line in _menu_item_localize() (menu.inc) would resolve the issue.

elseif ($callback && function_exists($callback)) {

It should be sufficient to instead use the following line.

elseif ($callback) {

However, I'm unsure whether showing blank titles instead of PHP warnings is in fact the intended behavior, which seems also inconsistent with the behavior for undefined page callback functions.

🐛 Bug report
Status

Needs review

Version

7.0 ⚰️

Component
Menu system 

Last updated about 21 hours ago

Created by

🇬🇧United Kingdom stuartraetaylor

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

Merge Requests

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