diff --git a/assets/plugins/templatesedit/class/templatesedit.class.php b/assets/plugins/templatesedit/class/templatesedit.class.php index 99b1470..d935551 100644 --- a/assets/plugins/templatesedit/class/templatesedit.class.php +++ b/assets/plugins/templatesedit/class/templatesedit.class.php @@ -179,7 +179,7 @@ protected function getTemplateVariables() } $sql = $this->evo->db->select(' - DISTINCT tv.*, IF(tvc.value!="",tvc.value,tv.default_text) as value', $this->evo->getFullTableName('site_tmplvars') . ' AS tv + DISTINCT tv.*, IF(tvc.value!="",tvc.value,tv.default_text) as value, tvtpl.rank', $this->evo->getFullTableName('site_tmplvars') . ' AS tv INNER JOIN ' . $this->evo->getFullTableName('site_tmplvar_templates') . ' AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN ' . $this->evo->getFullTableName('site_tmplvar_contentvalues') . ' AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid="' . $this->doc['id'] . '" LEFT JOIN ' . $this->evo->getFullTableName('site_tmplvar_access') . ' AS tva ON tva.tmplvarid=tv.id', 'tvtpl.templateid="' . $this->doc['template'] . '" AND (1="' . $_SESSION['mgrRole'] . '" OR ISNULL(tva.documentgroup)' . (!$docgrp ? '' : ' OR tva.documentgroup IN (' . $docgrp . ')') . ')', 'tvtpl.rank, tv.rank, tv.id'); diff --git a/assets/plugins/templatesedit/class/templateseditbuilder.class.php b/assets/plugins/templatesedit/class/templateseditbuilder.class.php index 171e1d6..993d3db 100644 --- a/assets/plugins/templatesedit/class/templateseditbuilder.class.php +++ b/assets/plugins/templatesedit/class/templateseditbuilder.class.php @@ -269,7 +269,7 @@ protected function getDefaultCategories() $sql = $this->evo->db->query(' SELECT *, category AS title FROM ' . $this->evo->getFullTableName('categories') . ' - ORDER BY rank, category + ORDER BY category '); if ($this->evo->db->getRecordCount($sql)) {