Skip to content
Snippets Groups Projects
Commit 0baa5d4d authored by mcramer's avatar mcramer
Browse files

Do not process sub templates if no main template (master template) is present!

parent 341c3dd5
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,9 @@
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 @@ class client_templates {
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;
}
/*
......
......@@ -29,6 +29,6 @@ class clients_template_plugin {
global $app;
$app->uses('client_templates');
$app->client_templates->apply_client_templates($page_form->id, $page_form->dataRecord);
$app->client_templates->apply_client_templates($page_form->id);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment