backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 39 forks source link

_menu_build_tree doesn't load include_file field from db, resulting in include not being loaded #3027

Open moonray opened 6 years ago

moonray commented 6 years ago

Describe your issue or idea

_menu_build_tree doesn't load the "include_file" field from db, resulting in the include not being loaded for, for a menu router entry like:

  $items['admin/structure/paragraphs/%paragraphs_bundle'] = array(
    'title' => 'Edit paragraph bundle',
    'title callback' => 'paragraphs_bundle_title_callback',
    'title arguments' => array(3),
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('paragraphs_admin_bundle_form', 3),
    'access arguments' => array('administer paragraphs bundles'),
    'file' => 'paragraphs.admin.inc',
  );

Steps to reproduce (if reporting a bug)

Visit the page URL at /admin/structure/paragraphs/SOMENAME

Actual behavior (if reporting a bug)

You will get an error like: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'paragraphs_bundle_title_callback' not found or invalid function name in _menu_item_localize() (line 753 of .../backdropcms/core/includes/menu.inc).

Expected behavior (if reporting a bug)

The include should be loaded, and all related callbacks should be executed.

Relevant version/system information (if applicable)

herbdool commented 6 years ago

Just curious: why does it work in D7 even though it also doesn't have the include_file either. Did it just work accidentally?