A service's edit page should surely be in the same tab set as its other admin pages:

- admin/structure/services/list/NAME/edit -- edit page
- admin/structure/services/list/NAME/resources -- resources settings page

Though this may be down to Ctools...

CommentFileSizeAuthor
#10 1179356.ctools.edit-not-in-tabs.patch519 bytesjoachim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kylebrowning’s picture

Status: Active » Closed (won't fix)

Unfortunately this a CTools thing.

joachim’s picture

Project: Services » Chaos Tool Suite (ctools)
Version: 7.x-3.x-dev » 7.x-1.x-dev
Status: Closed (won't fix) » Active

Let's move it to CTools then, as it makes the UI pretty awkward to use.

merlinofchaos’s picture

I don't understand. What's wrong here?

joachim’s picture

The exportable thing, in this case a service, is using the CTools exportable UI AFAIK.

In the list of all things, there is a dropdown that says:

- edit
- resources
- authentication
- ... [others too]

The paths to do stuff with a particular thing are of this form:

- admin/structure/services/list/NAME/edit -- edit page
- admin/structure/services/list/NAME/resources -- resources settings page
- admin/structure/services/list/NAME/authentication -- authentication settings page

All of these sit in menu tabs so once you are on one, you can easily flip to the others. Except for the edit page, which has no tabs at all.

merlinofchaos’s picture

Strange. It's defined as the default local task:

    'edit' => array(
      'path' => 'list/%ctools_export_ui/edit',
      'title' => 'Edit',
      'page callback' => 'ctools_export_ui_switcher_page',
      'page arguments' => array($plugin['name'], 'edit', $prefix_count + 2),
      'load arguments' => array($plugin['name']),
      'access callback' => 'ctools_export_ui_task_access',
      'access arguments' => array($plugin['name'], 'edit', $prefix_count + 2),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    ),
merlinofchaos’s picture

Maybe the issue is the %? If they don't match exactly, Drupal won't see them as being in the same tabset.

You can either change the % placeholder you're using, or define 'tab root' or 'tab parent' (I forget, it's kind of a weird system).

joachim’s picture

It's the edit page that seems to be at fault though. The others have a correct breadcrumb, whereas the edit page only has 'home'.

Interestingly, the menu_router table has entries with only % wildcards, not %ctools_export_ui as I expected, like this:

admin/structure/services/list/%/edit

All the other items get this as both their tab root and tab parent:

admin/structure/services/list/%

However, the edit page has the root set to itself, ie 'admin/structure/services/list/%/edit', but nothing for parent.

(BTW, probably another bug, but setting tab root or parent in the $plugin definition does not respect the menu prefix...)

Also, the type of the other items is 132, but for the edit page it's 0.

merlinofchaos’s picture

Are you running into the bug that Views ran into where the parentage can be set wrong because menu items get created when the schema is wrong? What happens if you clear the menu_links table for all 'services' links, then perform a menu rebuild? Does that fix the situation?

Also, the menu router table will omit the identifier from all % in the path, but that's still used (I think) when determining tab parentage. I'm...not actually sure I'm correct on that last part, though.

joachim’s picture

The problem seems to be this in ctools' export-ui.inc:

    'edit' => array(
      'path' => 'list/%ctools_export_ui/edit',
      'title' => 'Edit',
      'page callback' => 'ctools_export_ui_switcher_page',
      'page arguments' => array($plugin['name'], 'edit', $prefix_count + 2),
      'load arguments' => array($plugin['name']),
      'access callback' => 'ctools_export_ui_task_access',
      'access arguments' => array($plugin['name'], 'edit', $prefix_count + 2),
      'type' => MENU_CALLBACK, // callback?? hence never in the menu structure!
    ),
joachim’s picture

Status: Active » Needs review
FileSize
519 bytes

Here's a patch that fixes the problem in Services for me. The weight of -10 ensures the edit tab is the first, and gives implementing modules room to start their weights at 0.

joachim’s picture

Title: service edit page needs to be in same tab group as other admin pages » exportable UI edit page needs to be in same tab group as other admin pages
merlinofchaos’s picture

How come your paste in #9 does not match my paste in #5? It seems unlikely that I don't have the latest code...

joachim’s picture

It certainly does seem odd...

My git clone says:

~/Sites/7-drupal/sites/all/modules/ctools joachim$ git pull
Already up-to-date.
~/Sites/7-drupal/sites/all/modules/ctools joachim$ git st
# On branch 7.x-1.x
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   includes/export-ui.inc
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	1102024.ctools.admin-list-empty-rows.patch
#	1102038-show-text-with-no-items.patch
#	1179356.ctools.edit-not-in-tabs.patch
no changes added to commit (use "git add" and/or "git commit -a")

(The diff of the modified file being what I just uploaded as a patch :)

merlinofchaos’s picture

Status: Needs review » Fixed

Weird. I guess I *didn't* have the latest code in the branch I c&p'd that from.

I went back to menu default local task. Maybe I changed that while trying to figure out the weird problems i was having with breadcrumbs.

Status: Fixed » Closed (fixed)

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