From 1d8285d28a08853867d90703206f510256aff5c7 Mon Sep 17 00:00:00 2001
From: Tim Holt <hisboyelroymusic@gmail.com>
Date: Fri, 24 Oct 2014 19:48:42 -0500
Subject: [PATCH] adding in a hook to allow other modules to block items from
 entering the auto deployment plan

---
 modules/deploy_auto_plan/deploy_auto_plan.module | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/deploy_auto_plan/deploy_auto_plan.module b/modules/deploy_auto_plan/deploy_auto_plan.module
index 2a24cec..b6d4a6b 100644
--- a/modules/deploy_auto_plan/deploy_auto_plan.module
+++ b/modules/deploy_auto_plan/deploy_auto_plan.module
@@ -129,9 +129,13 @@ function deploy_auto_plan_settings($form, $form_state) {
 function _deploy_auto_plan_entity_save($entity, $type) {
   $plan_name = deploy_auto_plan_get_plan();
 
+  // Allow other modules to alter whether or not the entity should be added.
+  $status = TRUE;
+  drupal_alter('deploy_auto_plan_status', $status, $type, $entity);
+
   $info = entity_get_info($type);
-  if (!$plan_name || empty($info['entity keys']['uuid'])) {
-    // we only care about entities with UUIDs.
+  if (!$plan_name || empty($info['entity keys']['uuid']) || !$status) {
+    // We only care about entities with UUIDs or with a TRUE status.
     return;
   }
 
-- 
2.0.1

