From 0baa5d4d41c79e841dfc35a35a377f7316a145bb Mon Sep 17 00:00:00 2001 From: mcramer <m.cramer@pixcept.de> Date: Mon, 10 Sep 2012 10:37:31 -0400 Subject: [PATCH] Do not process sub templates if no main template (master template) is present! --- interface/lib/classes/client_templates.inc.php | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/client_templates.inc.php b/interface/lib/classes/client_templates.inc.php index 8631db0..7c86fcf 100644 --- a/interface/lib/classes/client_templates.inc.php +++ b/interface/lib/classes/client_templates.inc.php @@ -9,10 +9,8 @@ class client_templates { - function apply_client_templates($clientId, $limits = array()) { + function apply_client_templates($clientId) { global $app; - - if(!is_array($limits)) $limits = array(); /* * Get the master-template for the client @@ -28,6 +26,11 @@ if ($masterTemplateId > 0){ $sql = "SELECT * FROM client_template WHERE template_id = " . intval($masterTemplateId); $limits = $app->db->queryOneRecord($sql); + } else { + // if there is no master template it makes NO SENSE adding sub templates. + // adding subtemplates are stored in client limits, so they would add up + // on every save action for the client -> too high limits! + return; } /* -- Gitblit v1.9.1