Currently the views integration is completely broken. So I think we can do ...

  • Remove revert functionality
  • Re factor/write some of the views listing command to work and remove export type stuff
  • Fix enable/disable ops
  • Improved drush help meta info
  • Maybe some other things....

I know if/when views moves into core we will have to move this file to drush, but we might as well have a decent working version :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

damiankloip’s picture

FileSize
19.03 KB

More improvements and clean ups.

damiankloip’s picture

FileSize
20.91 KB

Some more changes

dawehner’s picture

+++ b/drush/views.drush.incundefined
@@ -263,235 +123,259 @@ function drush_views_list() {
+    $status_bool = ($status == 'enabled') ? TRUE : FALSE;

isn't it enough to just use $status == 'enabled' ?

+++ b/drush/views.drush.incundefined
@@ -263,235 +123,259 @@ function drush_views_list() {
-      $summary .= " tagged $tags";
...
+      $summary .= ' ' . dt('tagged with "@tags"', array('@tags' => $tags));

I like this change!

+++ b/drush/views.drush.incundefined
@@ -263,235 +123,259 @@ function drush_views_list() {
+  $views = entity_get_controller('view')->load($viewnames);

Just a small simplification couldn't be just use entity_load_multiple and if ($views = entity_load_multiple...) ?

damiankloip’s picture

FileSize
20.84 KB

Some good points!

tim.plunkett’s picture

+++ b/drush/views.drush.incundefined
@@ -263,235 +123,256 @@ function drush_views_list() {
+  $viewnames = func_get_args();

Should be $view_names

+++ b/drush/views.drush.incundefined
@@ -263,235 +123,256 @@ function drush_views_list() {
+function _views_drush_op($op = '', array $viewnames = array()) {

$view_names again

----

Running drush va gives me the wonderful

WD php: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "plugin.manager.views.display" does not exist. in             [error]
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 690 of
/Users/tim/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "plugin.manager.views.display" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 690 of /Users/tim/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Drush command terminated abnormally due to an unrecoverable error.   

Not really much we can do about that though....

dawehner’s picture

Even the update.php can't be runned at the moment, but hey this cleanup is worth to get it.

damiankloip’s picture

FileSize
20.9 KB

Yeah the whole DIC thing is a bit annoying atm... Here is a new patch with Tim's variable name change suggestions from #5.

tim.plunkett’s picture

FileSize
24.21 KB

Well, turns out there is a problem with Analyzer. I was trying out the code manually in devel/php, and it turned out that Drush is the only place that views_include('analyze');, so it was the only time that the bug in anaylzer was caught.

It's a hook, so it should be in the .module. Because of the move, the bug fix is not apparent; it was just s/$view->display/$view-displayHandlers

Status: Needs review » Needs work

The last submitted patch, views-1794144-8.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
24.29 KB

Whoops, rolled that while on the wrong branch.

tim.plunkett’s picture

Assigned: Unassigned » dawehner
Status: Needs review » Reviewed & tested by the community

I'm fine with this, but I think someone else should look/commit it.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

I'm totally fine with the analyze code. I just remember that the node: status analyze worked fine back in time.

Committed and pushed

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.