From 4432554c306c53ad6443628659179d919b63e51e Mon Sep 17 00:00:00 2001 From: Repellent Date: Sat, 22 Nov 2025 22:35:22 +0500 Subject: [PATCH] fix page 404 --- class/class.core.php | 25 +++++++++++++++++++++++-- functions/func.fields.php | 5 ++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/class/class.core.php b/class/class.core.php index 1cd9202..1bb6b43 100644 --- a/class/class.core.php +++ b/class/class.core.php @@ -1300,13 +1300,34 @@ $this->_coreRubricPermissionFetch(RUB_ID); - // Выполняем Код рубрики До загрузки документа +/* // Выполняем Код рубрики До загрузки документа ob_start(); eval(' ?>' . $this->curentdoc->rubric_start_code . 'curentdoc->rubric_start_code) + ? $this->curentdoc->rubric_start_code + : ''; + + if (!empty($start_code)) { + eval(' ?>' . $start_code . '_coreDocumentTemplateGet(RUB_ID, null, null, $this->curentdoc->rubric_template_id); + //$out = $this->_coreDocumentTemplateGet(RUB_ID, null, null, $this->curentdoc->rubric_template_id); + + // Определяем ID шаблона Если свойство не определено (на 404), используем 0. + $template_id = isset($this->curentdoc->rubric_template_id) + ? $this->curentdoc->rubric_template_id + : 0; + + // Получаем шаблон, используя безопасный ID + $out = $this->_coreDocumentTemplateGet(RUB_ID, null, null, $template_id); if (! ((isset ($_SESSION[RUB_ID . '_docread']) && $_SESSION[RUB_ID . '_docread'] == 1) || (isset ($_SESSION[RUB_ID . '_alles']) && $_SESSION[RUB_ID . '_alles'] == 1)) ) diff --git a/functions/func.fields.php b/functions/func.fields.php index c51672d..86a4544 100644 --- a/functions/func.fields.php +++ b/functions/func.fields.php @@ -444,7 +444,10 @@ } else { - $cache_time = $AVE_Core->curentdoc->rubric_changed_fields; + // Если свойство не определено (например, на странице 404), устанавливаем $cache_time в 0. + $cache_time = isset($AVE_Core->curentdoc->rubric_changed_fields) + ? $AVE_Core->curentdoc->rubric_changed_fields + : 0; } if ($cache_time == 0)