Skip to content

Commit

Permalink
Version 3.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronef committed Aug 10, 2022
2 parents 5994bdc + f9347f9 commit a01917f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# (MODX)EvolutionCMS.snippets.ddGetMultipleField changelog


## Version 3.8.2 (2022-08-10)
* \* Parameters:
* \* `columns`: Wrong working with the `0` value has been fixed.
* \* `colTpl`: Wrong working with the empty value has been fixed.


## Version 3.8.1 (2022-06-09)
* \* Parameters → `colTpl`: Support of various column numbers in different rows has been improved.

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG_ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# (MODX)EvolutionCMS.snippets.ddGetMultipleField changelog


## Версия 3.8.2 (2022-08-10)
* \* Параметры:
* \* `columns`: Исправлена некорректная работа со значением `0`.
* \* `colTpl`: Исправлена некорректная работа с пустым значением.


## Версия 3.8.1 (2022-06-09)
* \* Параметры → `colTpl`: Улучшена поддержка различного количества колонок в разных строках.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Features:
#### 1. Elements → Snippets: Create a new snippet with the following data

1. Snippet name: `ddGetMultipleField`.
2. Description: `<b>3.8.1</b> A snippet for processing, manipulations and custom output structured data (JSON or separated by delimiters strings).`.
2. Description: `<b>3.8.2</b> A snippet for processing, manipulations and custom output structured data (JSON or separated by delimiters strings).`.
3. Category: `Core`.
4. Parse DocBlock: `no`.
5. Snippet code (php): Insert content of the `ddGetMultipleField_snippet.php` file from the archive.
Expand Down Expand Up @@ -258,7 +258,7 @@ From the pair of `inputString` / `inputString_docField` parameters one is requir
* `stringChunkName`
* `string` — use inline templates starting with `@CODE:`
* `'null'` — specifies rendering without a template
* Default value:
* Default value: `'null'`

* `outerTpl`
* Desctription: Wrapper template (`outputFormat` has to be != `'array'`).
Expand Down
2 changes: 1 addition & 1 deletion README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#### 1. Элементы → Сниппеты: Создайте новый сниппет со следующими параметрами

1. Название сниппета: `ddGetMultipleField`.
2. Описание: `<b>3.8.1</b> Сниппет для обработки, изменения и произвольного вывода структурированных данных (JSON или разделённых через определённые разделители).`.
2. Описание: `<b>3.8.2</b> Сниппет для обработки, изменения и произвольного вывода структурированных данных (JSON или разделённых через определённые разделители).`.
3. Категория: `Core`.
4. Анализировать DocBlock: `no`.
5. Код сниппета (php): Вставьте содержимое файла `ddGetMultipleField_snippet.php` из архива.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dd/evolutioncms-snippets-ddgetmultiplefield",
"type": "modxevo-snippet",
"version": "3.8.1",
"version": "3.8.2",
"description": "A snippet for processing, manipulations and custom output structured data (JSON or separated by delimiters strings).",
"keywords": [
"modx",
Expand Down
2 changes: 1 addition & 1 deletion ddGetMultipleField_snippet.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* ddGetMultipleField
* @version 3.8.1 (2022-06-09)
* @version 3.8.2 (2022-08-10)
*
* @see README.md
*
Expand Down
11 changes: 7 additions & 4 deletions src/Snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Snippet extends \DDTools\Snippet {
protected
$version = '3.8.1',
$version = '3.8.2',

$params = [
//Defaults
Expand Down Expand Up @@ -52,7 +52,7 @@ class Snippet extends \DDTools\Snippet {

/**
* prepareParams
* @version 1.1 (2021-06-28)
* @version 1.1.2 (2022-08-10)
*
* @param $params {stdClass|arrayAssociative|stringJsonObject|stringHjsonObject|stringQueryFormatted}
*
Expand Down Expand Up @@ -92,7 +92,7 @@ protected function prepareParams($params = []){
}

if (
$this->params->columns != 'all' &&
$this->params->columns !== 'all' &&
!is_array($this->params->columns)
){
$this->params->columns = explode(
Expand Down Expand Up @@ -127,7 +127,10 @@ protected function prepareParams($params = []){
$this->params->{$paramName} = \ddTools::$modx->getTpl($this->params->{$paramName});
}

if (!empty($this->params->colTpl)){
if (empty($this->params->colTpl)){
//Without templates by default
$this->params->colTpl = [''];
}else{
//Получим содержимое шаблонов
foreach (
$this->params->colTpl as
Expand Down

0 comments on commit a01917f

Please sign in to comment.