From 63e67f8244893bc8a21cf0825b0f7bef3a00f8db Mon Sep 17 00:00:00 2001
From: Justin Ellison <justin.ellison@buckle.com>
Date: Mon, 1 Aug 2011 11:00:12 -0500
Subject: [PATCH 1/3] - #1202976 by justintime: Added check of
 node_gallery_install_defaults variable before
 installing types.

---
 node_gallery.install |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/node_gallery.install b/node_gallery.install
index a30fb97..819fcc4 100644
--- a/node_gallery.install
+++ b/node_gallery.install
@@ -216,11 +216,15 @@ function node_gallery_setup_content_types() {
 function node_gallery_install() {
   // If the user manages to install this module without the prerequisite modules enabled, this will enable them.
   module_enable(node_gallery_required_modules());
-  node_gallery_setup_content_types();
+  if (variable_get('node_gallery_install_defaults',1)) {
+    node_gallery_setup_content_types();
+  }
   $ret = drupal_install_schema('node_gallery');
-  node_gallery_install_imagecache_presets();
-  node_gallery_set_imagecache_permissions();
-  node_gallery_set_default_view_node_gallery_permissions();
+  if (variable_get('node_gallery_install_defaults',1)) {
+    node_gallery_install_imagecache_presets();
+    node_gallery_set_imagecache_permissions();
+    node_gallery_set_default_view_node_gallery_permissions();
+  }
 }
 
 /**
-- 
1.7.6


From 5c626b528dd7ad283cd8f716f125045102bb4955 Mon Sep 17 00:00:00 2001
From: Andrew Berry <deviantintegral@gmail.com>
Date: Tue, 2 Aug 2011 12:03:13 -0400
Subject: [PATCH 2/3] Issue #1202976 by deviantintegral: Uninstall the
 node_gallery_install_defaults variable if it's been
 set.

---
 node_gallery.install |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/node_gallery.install b/node_gallery.install
index 819fcc4..a76411a 100644
--- a/node_gallery.install
+++ b/node_gallery.install
@@ -216,11 +216,11 @@ function node_gallery_setup_content_types() {
 function node_gallery_install() {
   // If the user manages to install this module without the prerequisite modules enabled, this will enable them.
   module_enable(node_gallery_required_modules());
-  if (variable_get('node_gallery_install_defaults',1)) {
+  if (variable_get('node_gallery_install_defaults', 1)) {
     node_gallery_setup_content_types();
   }
   $ret = drupal_install_schema('node_gallery');
-  if (variable_get('node_gallery_install_defaults',1)) {
+  if (variable_get('node_gallery_install_defaults', 1)) {
     node_gallery_install_imagecache_presets();
     node_gallery_set_imagecache_permissions();
     node_gallery_set_default_view_node_gallery_permissions();
@@ -334,6 +334,7 @@ function node_gallery_uninstall() {
   $ret = drupal_uninstall_schema('node_gallery');
   $variables = array(
     'node_gallery_galleries_summary_view',
+    'node_gallery_install_defaults',
     'node_gallery_plupload_integration',
     'node_gallery_plupload_manage_images_integration',
     'node_gallery_plupload_manage_images_limit',
-- 
1.7.6


From f55b9fa8bc7c1bea98ab69e16dba175a74ebef6c Mon Sep 17 00:00:00 2001
From: Andrew Berry <deviantintegral@gmail.com>
Date: Tue, 2 Aug 2011 19:26:33 -0400
Subject: [PATCH 3/3] Issue #1202976 by deviantintegral: Use a boolean as the
 variable type for node_gallery_install_defaults.

---
 node_gallery.install |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/node_gallery.install b/node_gallery.install
index a76411a..7dd6ea2 100644
--- a/node_gallery.install
+++ b/node_gallery.install
@@ -216,11 +216,11 @@ function node_gallery_setup_content_types() {
 function node_gallery_install() {
   // If the user manages to install this module without the prerequisite modules enabled, this will enable them.
   module_enable(node_gallery_required_modules());
-  if (variable_get('node_gallery_install_defaults', 1)) {
+  if (variable_get('node_gallery_install_defaults', TRUE)) {
     node_gallery_setup_content_types();
   }
   $ret = drupal_install_schema('node_gallery');
-  if (variable_get('node_gallery_install_defaults', 1)) {
+  if (variable_get('node_gallery_install_defaults', TRUE)) {
     node_gallery_install_imagecache_presets();
     node_gallery_set_imagecache_permissions();
     node_gallery_set_default_view_node_gallery_permissions();
-- 
1.7.6

