Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be really handy to add Drush support.
To be able create, update, reset views.
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff-2462241-12-13.txt | 3.09 KB | mrded |
#13 | views_import-2462241-13.patch | 3.7 KB | mrded |
Comments
Comment #1
bigjim CreditAttribution: bigjim commentedThe 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
Comment #2
bigjim CreditAttribution: bigjim commentedWrote 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:
To export the frontpage view to views_import folder:
Comment #3
bigjim CreditAttribution: bigjim commentedOpps wrong patch :D
Comment #4
bigjim CreditAttribution: bigjim commentedMore updates, little things like including the drush callback function. ;)
Comment #5
mrded CreditAttribution: mrded commented@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.
Comment #6
bigjim CreditAttribution: bigjim commentedThis should do it.
I added a few fixes to issues already there ;)
Comment #7
bigjim CreditAttribution: bigjim commentedoops forgot the new files again (Git and I aren't friends this week)
Comment #8
bigjim CreditAttribution: bigjim commentedupdating to needs review
Comment #9
AlexKirienko CreditAttribution: AlexKirienko at WikiJob commented@bigjim Great patch! Thank you
Comment #10
mrded CreditAttribution: mrded commentedLooks like VIEWS_IMPORT_DIR constant is not visible from views_import.drush.inc file.
Comment #11
mrded CreditAttribution: mrded commentedOne more question: Why do you use --all=1 argument? Why not just --all?
Comment #12
mrded CreditAttribution: mrded commentedI made a fix of VIEWS_IMPORT_DIR visibility.
Comment #13
mrded CreditAttribution: mrded commentedI also made a quick refactoring, If you are interested.
Comment #16
mrded CreditAttribution: mrded as a volunteer and at WikiJob for WikiJob commented@bigjim, Thank you for your work! Great patch ;)