From 2feeb2077bfa4f68b0cb404a14c0bf4b73ecad6c Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <ericrasmussen1@gmail.com>
Date: Tue, 23 Oct 2012 17:23:35 -0500
Subject: [PATCH] [gh-500] Purge varnish when Draggable Views form is saved

---
 sites/all/modules/unl/unl_varnish/unl_varnish.module | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sites/all/modules/unl/unl_varnish/unl_varnish.module b/sites/all/modules/unl/unl_varnish/unl_varnish.module
index 14c7b3598..6589ef057 100644
--- a/sites/all/modules/unl/unl_varnish/unl_varnish.module
+++ b/sites/all/modules/unl/unl_varnish/unl_varnish.module
@@ -26,6 +26,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state
     '#title' => t('Purge varnish on all sites'),
     '#access' => user_access('administer varnish') && conf_path() == 'sites/default',
     '#weight' => -1,
+
     'varnish_path' => array(
       '#type' => 'radios',
       '#required' => TRUE,
@@ -35,6 +36,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state
       ),
       '#default_value' => '^/wdn',
     ),
+
     'purge' => array(
       '#type' => 'submit',
       '#value' => t('Purge varnish system-wide'),
@@ -82,3 +84,11 @@ function unl_varnish_file_update($file) {
 function unl_varnish_node_update($node) {
   varnish_purge_all_pages();
 }
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ * Purges varnish when a Draggable Views form is saved.
+ */
+function unl_varnish_form_views_form_drag_page_alter(&$form, $form_state, $form_id) {
+  $form['#submit'][] = 'varnish_purge_all_pages';
+}
-- 
GitLab