@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
13 | 13 | $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -2612,11 +2612,11 @@ discard block |
||
2612 | 2612 | if (isset($this->snippetCache[$snip_name])) { |
2613 | 2613 | $snippetObject['name'] = $snip_name; |
2614 | 2614 | $snippetObject['content'] = $this->snippetCache[$snip_name]; |
2615 | - if (isset($this->snippetCache["{$snip_name}Props"])) { |
|
2616 | - if (!isset($this->snippetCache["{$snip_name}Props"])) { |
|
2617 | - $this->snippetCache["{$snip_name}Props"] = ''; |
|
2615 | + if (isset($this->snippetCache["{$snip_name}props"])) { |
|
2616 | + if (!isset($this->snippetCache["{$snip_name}props"])) { |
|
2617 | + $this->snippetCache["{$snip_name}props"] = ''; |
|
2618 | 2618 | } |
2619 | - $snippetObject['properties'] = $this->snippetCache["{$snip_name}Props"]; |
|
2619 | + $snippetObject['properties'] = $this->snippetCache["{$snip_name}props"]; |
|
2620 | 2620 | } |
2621 | 2621 | } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) { |
2622 | 2622 | $snippetObject['name'] = trim($snip_name, '@'); |
@@ -2645,7 +2645,7 @@ discard block |
||
2645 | 2645 | $snippetObject['content'] = $snip_content; |
2646 | 2646 | $snippetObject['properties'] = $snip_prop; |
2647 | 2647 | $this->snippetCache[$snip_name] = $snip_content; |
2648 | - $this->snippetCache["{$snip_name}Props"] = $snip_prop; |
|
2648 | + $this->snippetCache["{$snip_name}props"] = $snip_prop; |
|
2649 | 2649 | } |
2650 | 2650 | return $snippetObject; |
2651 | 2651 | } |
@@ -3960,7 +3960,7 @@ discard block |
||
3960 | 3960 | } |
3961 | 3961 | // build query |
3962 | 3962 | $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
3963 | - $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc |
|
3963 | + $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc |
|
3964 | 3964 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
3965 | 3965 | $resourceArray = $this->getDatabase()->makeArray($result); |
3966 | 3966 | $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray; |
@@ -3997,7 +3997,7 @@ discard block |
||
3997 | 3997 | } |
3998 | 3998 | // build query |
3999 | 3999 | $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
4000 | - $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc |
|
4000 | + $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc |
|
4001 | 4001 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
4002 | 4002 | $resourceArray = $this->getDatabase()->makeArray($result); |
4003 | 4003 | |
@@ -4053,7 +4053,7 @@ discard block |
||
4053 | 4053 | $tblsc = $this->getDatabase()->getFullTableName('site_content'); |
4054 | 4054 | $tbldg = $this->getDatabase()->getFullTableName('document_groups'); |
4055 | 4055 | |
4056 | - $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc |
|
4056 | + $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc |
|
4057 | 4057 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
4058 | 4058 | |
4059 | 4059 | $resourceArray = $this->getDatabase()->makeArray($result); |
@@ -4119,7 +4119,7 @@ discard block |
||
4119 | 4119 | $tblsc = $this->getDatabase()->getFullTableName('site_content'); |
4120 | 4120 | $tbldg = $this->getDatabase()->getFullTableName('document_groups'); |
4121 | 4121 | |
4122 | - $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc |
|
4122 | + $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc |
|
4123 | 4123 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
4124 | 4124 | |
4125 | 4125 | $resourceArray = $this->getDatabase()->makeArray($result); |
@@ -4707,7 +4707,7 @@ discard block |
||
4707 | 4707 | $template = $doc['content']; |
4708 | 4708 | break; |
4709 | 4709 | case 'SELECT': |
4710 | - $this->getDatabase()->getValue($this->getDatabase()->query("SELECT {$template}")); |
|
4710 | + $this->getDatabase()->getValue($this->getDatabase()->query("select {$template}")); |
|
4711 | 4711 | break; |
4712 | 4712 | default: |
4713 | 4713 | if (!($template = $this->getChunk($tpl))) { |