From this issue >> https://www.drupal.org/project/drupal/issues/3021824 it appears that hook_menu requires a non-null title or issues can occur on DB CRUD actions.

This module does not set a non-null title, i.e.

  $items['<nolink>'] = array(
    'page callback' => 'drupal_not_found',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  $items['<separator>'] = array(
    'page callback' => 'drupal_not_found',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

I believe I have encountered this issue on a site using Special Menu Items and perhaps a patch is in order.

Screenshot is from the database constraints (credit to @btopro).

E

Comments

aitala created an issue. See original summary.

aitala’s picture

aitala’s picture

StatusFileSize
new580 bytes

Here is a patch (I think I did this correctly)

E

poker10’s picture

Status: Active » Needs review

+1, the patch is working for me. I am using it on some projects to eliminate errors caused by NULL title.

  • poker10 committed 64227fca on 7.x-2.x authored by aitala
    Issue #3021939 by aitala: hook_menu requires a non-null title
    
poker10’s picture

Status: Needs review » Fixed

Similar approach with empty title is used also in core, so it should be OK. See: https://git.drupalcode.org/project/drupal/-/blob/7.x/modules/overlay/overlay.module#L26

Committed this, thanks @aitala!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.