Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Snippet hook_menu and snippet h_menu are missing quotes around the 'file' value.
In the file bundle/vim-plugin-for-drupal/snippets/drupal7/php.snippets
snippet h_menu
/**
* Implements hook_menu().
*/
function `Filename()`_menu() {
$items['${1}'] = array(
'title' => '${2}',
'page callback' => '${3}',
'page arguments' => array(${4}),
'access arguments' => array('${5}'),
'type' => ${6},
'file' => ${7},${8}
);
return $items;
}
'file' should be
'file' => '${7}',${8}
And in bundle/vim-plugin-for-drupal/snippets/drupal/php.snippets
snippet hook_menu
/**
* Implements hook_menu().
*/
function `Filename()`_menu() {
/*
*$items['blog'] = array(
* 'title' => 'blogs',
* 'page callback' => 'blog_page',
* 'access arguments' => array('access content'),
* 'type' => MENU_SUGGESTED_ITEM,
*);
*/
$items['${1:path/to/register}'] = array(
'title' => '${2:Page title}',
'page callback' => '${3:callback_function}',
'page arguments' => array(${4}),
'access arguments' => array('${5:View published content}'),
'type' => ${6:MENU_NORMAL_ITEM}, // MENU_CALLBACK, MENU_LOCAL_TASK, MENU_DEFAULT_LOCAL_TASK, MENU_LOCAL_ACTION, MENU_SUGGESTED_ITEM,
// 'file' => ${7:`Filename()`.pages.inc},
);
return $items;
}
'file' should be
// 'file' => '${7:`Filename()`.pages.inc}',
Comment | File | Size | Author |
---|---|---|---|
#2 | vimrc-hook_menu_quotes_missing-2727355-2.patch | 1.19 KB | vtcore |
Comments
Comment #2
vtcore CreditAttribution: vtcore commentedPatch attached.
Comment #4
rodrigoaguileraCommited. Thanks!!