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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salvis’s picture

I'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.

nevergone’s picture

Status: Active » Needs review
FileSize
1.93 KB

Needs review.

nevergone’s picture

without check_plain()

Zoltán Balogh’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

salvis’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1017 bytes

Since 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.

  • salvis committed 496880d on 7.x-1.x
    Issue #1169726 by salvis: Hard-coded links in menu item descriptions...
salvis’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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