Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi @all,
I just mentioned that the module uses hard-coded links in three of its menu items:
devel.module
$items['devel/settings'] = array(
'title' => 'Devel settings',
'description' => 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the <a href="' . url('admin/structure/block') . '">block administration</a> page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('devel_admin_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'devel.admin.inc',
'menu_name' => 'devel',
);
$items['admin/config/development/devel'] = array(
'title' => 'Devel settings',
'description' => 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the <a href="' . url('admin/structure/block') . '">block administration</a> page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('devel_admin_settings'),
'file' => 'devel.admin.inc',
'access arguments' => array('administer site configuration'),
);
devel_node_access.module
$items['admin/config/development/devel'] = array(
'title' => 'Devel settings',
'description' => 'Helper pages and blocks to assist Drupal developers and admins with node_access. The devel blocks can be managed via the <a href="' . url('admin/structure/block') . '">block administration</a> page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('devel_node_access_admin_settings'),
'access arguments' => array('administer site configuration'),
);
This makes the description untranslatable, as potx won't extract the string completely and the translation source changes e.g. every time you use a different base path.
So I guess the link has to be removed from that description an should be placed in hook_help() instead.
Thanx in advance & cheers
TOM
Comment | File | Size | Author |
---|---|---|---|
#5 | hard_coded_links_in_menu_item_descriptions-1169726-5.patch | 1017 bytes | salvis |
|
Comments
Comment #1
salvisI'm not even sure the link in the description for the first menu item can be seen anywhere. It doesn't show up in the mouse-over hint of the menu item.
The others do show up as link on the admin/config/development page, but I don't know whether anyone even looks at that page.
Actually, it might make more sense to move the second sentence into a note at the top of the Devel Settings page, where it could be properly t()ed.
Comment #2
nevergone CreditAttribution: nevergone commentedNeeds review.
Comment #3
nevergone CreditAttribution: nevergone commentedwithout check_plain()
Comment #4
Zoltán Balogh CreditAttribution: Zoltán Balogh commentedLooks good
Comment #5
salvisSince Titles and Descriptions should no longer be wrapped in t(). We cannot have replaceable variables in menu descriptions anymore, whether with t() nor with format_string(). This means we have to put the <a> tag directly into the string.
This was already fixed in devel.module, and the attached patch fixes it in devel_node_access.module.
Comment #7
salvis