In the 7.x version of the module, if one navigates to the 'Structure' -> 'Views' menu, these are the menus/submenus they see:

- Add new view
- Edit
- Edit
- Edit
...
- Edit
- Import view from code
- Tools
- Basic
- Bulk export
- Convert

Now, there might be a different number of such 'Edit' links (also depends on which modules you have installed), but no matter if the respective view is enabled or not, it still shows its 'Edit' link (points to ../admin/structure/views/edit/[view_name]).

It would be more appropriate to display the view names instead of simple meaningless 'Edit' menu items and have them show either 'Enable' or 'Edit'/'Export'/'Clone'/'Disable' child items, depending on their status (view is enabled or not). Like so:

- Add new view
- archive (default)
- Edit
- Export
- Clone
- Disable
- comments_recent (default)
- Enable
- frontpage (default)
- Edit
- Export
- Clone
- Disable
...
- taxonomy_term (default)
- Enable
- Import view from code
- Tools
- Basic
- Bulk export
- Convert

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klonos’s picture

... sorry, should have enclosed the menu structures in <code> tags. Someone with the permission to edit issue description please correct that for me.

Thanx.

tim.plunkett’s picture

Status: Active » Needs review
FileSize
2.71 KB

This patch "works". It's not elegant, and it doesn't do everything listed above.

This patch creates a link "Edit %viewname" for all enabled views and a link "Enable %viewname" for all disabled views.

Having a menu like

comments_recent (default)
  Edit
  Export
  Clone
  Disable

would be nice, but views don't have their own page, so comments_recent (default) and Edit would be redundant.

This probably needs some help, and definitely needs comments. I'm marking it as needs review though, just to make sure I'm on the right track.

klonos’s picture

Status: Needs review » Needs work
FileSize
18.97 KB
32.21 KB

Not much action on this one :(

...here's a screenshot of the issue + another screenshot of the menu after the patch is applied. With the patch applied in latest dev of the module, under latest D7-dev core and once caches are flushed I do see the enabled views' names next to the 'Edit' text. I do NOT see any entries for the disabled views though. Also, I receive a series of repeated (146 times with the default set of views - if that makes any difference) error messages of:

Notice: Undefined index: hook in admin_menu_merge_tree() (line 266 of /var/www/d7test/sites/all/modules/admin_menu/admin_menu.inc).

I don't know if this is the cause of disabled views + their respective 'Enable' submenus not being displayed. Setting it to 'needs work' because of the above.

Thanx for your work Tim ;)

PS: I think I'd like it better if the menu items said 'Edit [view_name] view', because 'Edit admin_content' and 'Edit admin_users' might be misleading for example.

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

I'm surprised the patch even applied anymore. I'll take another look at this soon.

klonos’s picture

Thanx in advance ;)

rudiedirkx’s picture

This issue is still not resolved.

sun’s picture

@smk-ka once created a patch for Views to fix this, but that was >1 year ago, and unfortunately, I've never seen its contents.

This current patch here contains special code for Views, which is a no-go. We need to fix this properly.

Perhaps it might also be a good idea to remove the Views UI support code from admin_menu and add the hook implementation to Views UI instead.

Dave Reid’s picture

+1 for removing views_ui support until it can be worked out where it needs to be and how it needs to be done

klonos’s picture

+1 for removing views_ui support until it can be worked out where it needs to be and how it needs to be done

Then perhaps this issue here needs to be set to 'postponed' till this happens. Anyone filled a new issue for that in the Views issue queue? If so, then please link.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned

I feel guilty for having left this assigned to me.

ropaolle’s picture

Subscribe

tomas.teicher’s picture

FileSize
480 bytes

I made javascript workaround while the module solution is out. Hope this helps. Works for me in mozilla and chrome (I don't use IE for administration)

echoz’s picture

subscribe

rudiedirkx’s picture

FileSize
73.29 KB

Tim's patch works fine: http://drupal.org/node/884032#comment-3336176

I've (manually) patched two files with it and now decent titles are shown.

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

The Views 3 UI was just merged in, so everything is different. I'll try this again.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned

Just a heads up: Views now depends on CTools to define many of its menu items, via ctools/includes/export-ui.inc.

In my installation, admin/structure/views/add, admin/structure/views/add-template, admin/structure/views/settings are all in line with admin/structure/%.

Instead of admin/structure/views/edit/%view_name, its admin/structure/views/view/%view_name/edit.

Also, the links provided by Ctools are not in menu_links, which prevents them from being displayed.

tim.plunkett’s picture

Okay, this is much less confusing now in light of #1127410: Views Admin Breadcrumb Missing.

klonos’s picture

I thought I'd give this another go, so a couple of quick questions @Tim:

1. are you working on this at all atm?
2. based on #16 should I even dare to apply #2?

tim.plunkett’s picture

@klonos, I'm not working on this at all. And I'm 99% sure my patch is useless now, even as a starting point...

klonos’s picture

k, I kinda already knew but had to make sure. I appreciate you even took the time to reply.

klonos’s picture

Status: Needs work » Active

...setting it to a status that means more "we need to start over" (as per #16, #17, #19 etc.) than "we need to work on what's already done".

sun’s picture

Sorry for the noise; now for real.

klonos’s picture

Title: The 'Views' menu contains a series of 'Edit' links - even for disabled views - without the respective view name » Add 'Edit' links for enabled views in the 'Views' menu (with the respective view name) & 'Enable' links for disabled views.
Category: bug » feature

Now, there are no "Edit" links at all available in the menu. Shouldn't we get them back first?

sun’s picture

Title: Add 'Edit' links for enabled views in the 'Views' menu (with the respective view name) & 'Enable' links for disabled views. » Add enabled views to the 'Views' menu
Status: Active » Needs work
Issue tags: -D7 stable release blocker

Keeping this here for now, until the hook implementation has been moved over to http://drupal.org/project/admin_views

sun’s picture

oh, I'm terribly sorry! #26 is total BS. admin_views has nothing to do with this issue :)

sun’s picture

Status: Needs work » Needs review
FileSize
815 bytes

Attached patch works for me.

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed to all branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

klonos’s picture

It works fine. The only thing is that some views names are so long (and the width of the li only 160px) that they wrap to 3-4 lines for some cases. This will get worse as the number of enabled views increases for a site and since the Structure -> Views item is already the last in the menu, it will cause the last views listed to "hide" off the screen.

Could we somehow ad a class to the specific li tags so we can target them in css and increase their width?

Status: Fixed » Closed (fixed)
Issue tags: -D7 stable release blocker

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