From f1d07b4dd88c79f91213a0fba99d1dd6c83798ca Mon Sep 17 00:00:00 2001 From: soniiix <124884897+soniiix@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:26:42 +0200 Subject: [PATCH 1/3] Fix PHP syntax error in ActionColumn example The original code used ->add() inside an array, which is invalid; it now adds the LinkRowAction correctly. --- development/components/grid/columns-reference/action.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/components/grid/columns-reference/action.md b/development/components/grid/columns-reference/action.md index 2160da638c..4c08e7780f 100644 --- a/development/components/grid/columns-reference/action.md +++ b/development/components/grid/columns-reference/action.md @@ -27,7 +27,7 @@ $actionColumn = new ActionColumn('actions'); $actionColumn->setName('Actions'); $actionColumn->setOptions([ 'actions' => [ - ->add((new LinkRowAction('delete')) + ((new LinkRowAction('delete')) ->setIcon('delete') ->setOptions([ 'route' => 'admin_custom_route', From 638cd1785cd007a91301795967154bb079f1dadf Mon Sep 17 00:00:00 2001 From: soniiix <124884897+soniiix@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:52:11 +0200 Subject: [PATCH 2/3] Fix ActionColumn example by using RowActionCollection The 'actions' option expects a RowActionCollection object rather than an array. --- development/components/grid/columns-reference/action.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/development/components/grid/columns-reference/action.md b/development/components/grid/columns-reference/action.md index 4c08e7780f..93c1e24646 100644 --- a/development/components/grid/columns-reference/action.md +++ b/development/components/grid/columns-reference/action.md @@ -22,12 +22,13 @@ For more info about possible actions see [Actions reference][actions-reference]. use PrestaShop\PrestaShop\Core\Grid\Column\Type\Common\ActionColumn; use PrestaShop\PrestaShop\Core\Grid\Column\ColumnCollection; use PrestaShop\PrestaShop\Core\Grid\Action\Row\Type\LinkRowAction; +use PrestaShop\PrestaShop\Core\Grid\Action\Row\RowActionCollection; $actionColumn = new ActionColumn('actions'); $actionColumn->setName('Actions'); $actionColumn->setOptions([ - 'actions' => [ - ((new LinkRowAction('delete')) + 'actions' => (new RowActionCollection()) + ->add((new LinkRowAction('delete')) ->setIcon('delete') ->setOptions([ 'route' => 'admin_custom_route', From c55626a72c97db31cca5f29552f8afb73bcdf92f Mon Sep 17 00:00:00 2001 From: soniiix <124884897+soniiix@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:11:38 +0200 Subject: [PATCH 3/3] Fix: remove extra closing bracket --- development/components/grid/columns-reference/action.md | 1 - 1 file changed, 1 deletion(-) diff --git a/development/components/grid/columns-reference/action.md b/development/components/grid/columns-reference/action.md index 93c1e24646..4eaefb37cc 100644 --- a/development/components/grid/columns-reference/action.md +++ b/development/components/grid/columns-reference/action.md @@ -37,7 +37,6 @@ $actionColumn->setOptions([ 'confirm_message' => 'Delete selected item?', ]) ) - ], ]); $columns = new ColumnCollection();