If, in the definition for your export UI plugin, you use a menu path longer than a single item, the menu paths are generated with incorrect 'page argument' keys.

e.g. this works:

  ...
  // Define the menu item.
  'menu' => array(
    'menu item' => 'profiles',
    'menu title' => 'Source profiles',
    'menu description' => 'Administer source profiles.',
  ),
  ...

but this does not:

  ...
  // Define the menu item.
  'menu' => array(
    'menu item' => 'source/profiles',
    'menu title' => 'Source profiles',
    'menu description' => 'Administer source profiles.',
  ),
  ...

This is caused by ctools_export_ui_process() assuming that the path length is 2 elements (the menu item + the action) when in fact it can be longer.

Patch coming...

CommentFileSizeAuthor
#1 1922064-fix-export-ui-paths.patch6.17 KBxtfer

Comments

xtfer’s picture

Status: Active » Needs review
StatusFileSize
new6.17 KB

This patch sets the 'page arguments' and 'access arguments' argument position key dynamically by counting the number of path items provided in the 'menu item' key on the plugin definition, rather than assuming it is always 1 path item only.

mcrittenden’s picture

Wouldn't you just use the "menu prefix" array key to make that work instead of making "menu item" have more than one item?

 'menu' => array(
    'menu prefix' => 'admin/config/search',
    'menu item' => 'profiles',
    'menu title' => 'Search Profiles',
    'menu description' => 'Administer search profiles.',
  ),
mcrittenden’s picture

Issue summary: View changes

Fixed second example

chris matthews’s picture

Issue summary: View changes

The 6 year old patch applied cleanly to the latest ctools 7.x-1.x-dev, and if applicable still needs to be reviewed and tested by the community.

Checking patch includes/export-ui.inc...
Hunk #1 succeeded at 108 (offset -1 lines).
Hunk #2 succeeded at 162 (offset -1 lines).
Hunk #3 succeeded at 173 (offset -1 lines).
Hunk #4 succeeded at 200 (offset -1 lines).
Hunk #5 succeeded at 215 (offset -1 lines).
Hunk #6 succeeded at 229 (offset -1 lines).
Hunk #7 succeeded at 243 (offset -1 lines).
Hunk #8 succeeded at 257 (offset -1 lines).
Hunk #9 succeeded at 271 (offset -1 lines).
Applied patch includes/export-ui.inc cleanly.
japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.