Skip to content

Commit

Permalink
fix smarty errors (#11)
Browse files Browse the repository at this point in the history
* fix smarty errors

* fix AuditLogModule

---------

Co-authored-by: Yuri.Bushenko <gitlab.com_nastro000@gmail.com>
  • Loading branch information
Nastro and Yuri.Bushenko authored Dec 14, 2023
1 parent 3e45002 commit fd37633
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## [3.0.3] 2023-12-14
- Исправлена ошибка в Smarty при использовании функции addTemplateFunction
- Исправлена ошибка в AuditLogModule

## [3.0.2] 2023-10-30
- Обновлена мажорная версия monolog/monolog до ^3.0 lock = `3.5.0`
- Исправлена ошибка в PXStorageTypeSerialized при использовании некорректного json
Expand Down
14 changes: 7 additions & 7 deletions lib/HTML/layout.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class PXUserHTMLLayout implements LayoutInterface
$this->_filters = [];
$this->indexTemplate = 'index.tmpl';

$this->addTemplateFunction('property', $this->getProperty(...));
$this->addTemplateModifier('property', $this->getPropertyModifier(...));
$this->addTemplateFunction('pager', $this->pager(...));
$this->addTemplateFunction('property', [$this, 'getProperty']);
$this->addTemplateModifier('property', [$this, 'getPropertyModifier']);
$this->addTemplateFunction('pager', [$this, 'pager']);

$this->_initLang();
}
Expand Down Expand Up @@ -74,11 +74,11 @@ class PXUserHTMLLayout implements LayoutInterface
require_once PPLIBPATH . 'HTML/lang.class.inc';

$this->lang = new PXUserHTMLLang();
$this->addTemplateFunction('lang', $this->lang->lang(...));
$this->addTemplateModifier('lang', $this->lang->lang_modifier(...));
$this->addTemplateFunction('lang', [$this->lang, 'lang']);
$this->addTemplateModifier('lang', [$this->lang, 'lang_modifier']);

$this->addTemplateFunction('pager', $this->pager(...));
$this->addTemplateFunction('autopager', $this->autopager(...));
$this->addTemplateFunction('pager', [$this, 'pager']);
$this->addTemplateFunction('autopager', [$this, 'autopager']);
}

public function htmlPager($totalObjects, $objectsPerPage, &$smarty, $param)
Expand Down
2 changes: 1 addition & 1 deletion lib/common.version.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

define('PP_VERSION', 'v3.0.2');
define('PP_VERSION', 'v3.0.3');
2 changes: 1 addition & 1 deletion src/Module/AuditLogModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct($area, $settings)
{
parent::__construct($area, $settings);

if (is_callable($this->layout->setOneColumn(...))) {
if (is_callable([$this->layout, 'setOneColumn'])) {
$this->layout->setOneColumn();
}
}
Expand Down

0 comments on commit fd37633

Please sign in to comment.