We added quite a bit of Views integration in the Aegir 2.x dev cycle. Much of this needs to be ported to Views 3.x.

  1. Registering VBO actions has also changed, and work was started in #2049495: Move tasks from node_operations to actions.
  2. We should move the lists of backups to use views: #2022839: Convert backup lists to a view.
  3. Hopefully Views 7.x-3.x provides better control over access to displays, and will allow us to register multiple views to the same path: #2035873: Show package 'popularity' on platform package view.
  4. If I'm feeling really ambitious, I might try tackling #1876354: Convert list of servers to use views.

I believe there's also still quite a bit of the original list-page generating code. This should be removed.

Comments

ergonlogic’s picture

The principle issue appears to be the way Views 3.x registers handlers. This is done with a files[] entry in the .info, rather than hook_views_handlers().

I'm also taking this opportunity to clean up and standardize the directory structure for views components. They'll now all go in /includes/views, with subdirectories for handlers, plugins, etc.

So far hosting and hosting_site are done.

ergonlogic’s picture

Title: Fix Views integration » [META] Fix Views integration
Issue summary: View changes
ergonlogic’s picture

I'm also cleaning up name-spacing for our views plugins. The field handler standard appears to be _field_handler_. So, for example, hosting_platform_handler_field_status. The filename will be that with '.inc' appended. The class name within will have to change, as do any references to the class, such as in hook_views_data(). That is usually enough to fix the 'broken/missing handler' errors.

Also, VBO changed to being a field, from a style plugin. So, we need to switch the format to table. To get our styling, we need to add a row class (table format settings) of [status].

Finally, our Views are creating menu links in the wrong menu, so we need to update it to the main menu.

ergonlogic’s picture

Client, Task, Package and Platform done. That should be pretty much it for the initial cleanup. We may be registering some missing handlers (i.e., hosting_task_handler_sort_default).

ergonlogic’s picture

I've begun to use Views alter hooks to reduce the number of displays per view. This will make changes much easier to manage. For site views, for example, we'd previously had different block displays on profiles, platforms, etc. pages. Sometimes even more than one: an 'admin' display that had vbo enabled, and another that just listed the sites. All these displays were otherwise largely identical.

Now, we selectively alter them as appropriate. Currently, we remove the vbo for anyone without the 'administer sites' permission, and remove all but the appropriate contextual filter/argument depending on the type of node we're viewing. We also use a block alter hook to only show our views on servers running a db service, and profile packages.

Note that I'm not sure that last condition is really required. Currently, we only show the site list on package nodes that are install profiles. I think this is a legacy of previously limited relationship handlers. I believe we can (and probably should) display a list of sites on all package pages.