diff --git a/core/components/collections/docs/changelog.txt b/core/components/collections/docs/changelog.txt index 6048fd2..aa18691 100644 --- a/core/components/collections/docs/changelog.txt +++ b/core/components/collections/docs/changelog.txt @@ -2,6 +2,7 @@ Changelog for Collections. Collections 3.4.0 =================== +- Pass column name to snippet renderer - Prevent permanent sort breaking D&D sort - Add Collections.renderer.buttons renderer - Allow snippet renderer on non-existing column diff --git a/core/components/collections/processors/mgr/resource/getlist.class.php b/core/components/collections/processors/mgr/resource/getlist.class.php index 574ad65..c5648b3 100644 --- a/core/components/collections/processors/mgr/resource/getlist.class.php +++ b/core/components/collections/processors/mgr/resource/getlist.class.php @@ -309,7 +309,7 @@ public function prepareRowWithRenderer(xPDOObject $object) { foreach ($this->columnRenderer as $field => $snippet) { $value = isset($resourceArray[$field]) ? $resourceArray[$field] : null; - $resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value)); + $resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value, 'column' => $field)); } $resourceArray = $this->prepareSupportFields($resourceArray); diff --git a/core/components/collections/processors/mgr/selection/getlist.class.php b/core/components/collections/processors/mgr/selection/getlist.class.php index 570662b..08be11a 100644 --- a/core/components/collections/processors/mgr/selection/getlist.class.php +++ b/core/components/collections/processors/mgr/selection/getlist.class.php @@ -253,7 +253,7 @@ public function prepareRowWithRenderer(xPDOObject $object) { foreach ($this->columnRenderer as $field => $snippet) { $value = isset($resourceArray[$field]) ? $resourceArray[$field] : null; - $resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value)); + $resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value, 'column' => $field)); } $resourceArray = $this->prepareSupportFields($resourceArray);