Comments

bigjim’s picture

The last one you can accomplish already, you can reset Views using the vr command that ships with views

ie:
drush vr <view_name>
or
drush vr --all

bigjim’s picture

StatusFileSize
new1.63 KB

Wrote a patch to support exporting files using drush.

Adds the vie command which supports options for writing individual views or all the views in the system.

Usage
To export all views to views_import folder:

drush vie --all

To export the frontpage view to views_import folder:

drush vie frontpage
bigjim’s picture

StatusFileSize
new1.63 KB

Opps wrong patch :D

bigjim’s picture

StatusFileSize
new2.79 KB

More updates, little things like including the drush callback function. ;)

mrded’s picture

Status: Active » Needs work

@bigjim, thanks a lot for your patch, that's really helpful!

Can you also fix a code style if you don't mind? Or I can do it myself.

bigjim’s picture

StatusFileSize
new1.68 KB

This should do it.

I added a few fixes to issues already there ;)

bigjim’s picture

StatusFileSize
new3.29 KB

oops forgot the new files again (Git and I aren't friends this week)

bigjim’s picture

Status: Needs work » Needs review

updating to needs review

AlexKirienko’s picture

@bigjim Great patch! Thank you

mrded’s picture

Status: Needs review » Needs work

Looks like VIEWS_IMPORT_DIR constant is not visible from views_import.drush.inc file.

drush vie --all
file_put_contents(VIEWS_IMPORT_DIR/reviews.inc): failed to open      [warning]
stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/nodes.inc): failed to open stream:[warning]
No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/archive.inc): failed to open      [warning]
stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/comments_recent.inc): failed to   [warning]
open stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/frontpage.inc): failed to open    [warning]
stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/glossary.inc): failed to open     [warning]
stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/taxonomy_term.inc): failed to open[warning]
stream: No such file or directory views_import.drush.inc:50
file_put_contents(VIEWS_IMPORT_DIR/tracker.inc): failed to open      [warning]
stream: No such file or directory views_import.drush.inc:50
mrded’s picture

One more question: Why do you use --all=1 argument? Why not just --all?

mrded’s picture

StatusFileSize
new3.66 KB
new618 bytes

I made a fix of VIEWS_IMPORT_DIR visibility.

mrded’s picture

Status: Needs work » Needs review
StatusFileSize
new3.7 KB
new3.09 KB

I also made a quick refactoring, If you are interested.

  • mrded committed e0a8699 on 7.x-1.x authored by bigjim
    Issue #2462241 by bigjim, mrded: Drush support
    

  • mrded committed 1b3da58 on 7.x-1.x
    Issue #2462241 by mrded: Refactor drush support
    
mrded’s picture

Status: Needs review » Fixed

@bigjim, Thank you for your work! Great patch ;)

Status: Fixed » Closed (fixed)

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