From c94b18b196841f7eeb42b024113838d838200a5a Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Tue, 4 Feb 2025 12:01:58 +0100 Subject: [PATCH 1/3] Fix containers migration while adding is_recursive field --- templates/container.class.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/container.class.tpl b/templates/container.class.tpl index 97159ae9..58bd527f 100644 --- a/templates/container.class.tpl +++ b/templates/container.class.tpl @@ -106,7 +106,10 @@ class %%CLASSNAME%% extends PluginFieldsAbstractContainerInstance * This block ensures that the 'is_recursive' field is created and populated if it * associated item type requires recursive assignment */ - if (getItemForItemtype("%%ITEMTYPE%%")->maybeRecursive() && !$DB->fieldExists($table, 'is_recursive')) { + if ( + getItemForItemtype("%%ITEMTYPE%%")->maybeRecursive() + && !$DB->fieldExists($table, 'is_recursive') + && $DB->fieldExists($table, 'entities_id')) { $migration->addField($table, 'is_recursive', 'bool', ['after' => 'entities_id']); $migration->addKey($table, 'is_recursive'); $migration->executeMigration(); From fee1a3c663b885ca714491dea1fc854ceca8325c Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Thu, 20 Mar 2025 10:06:43 +0100 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 255f7435..ee9dbf31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASE] +### Fixed + +- Fix containers migration while adding is_recursive field ## [1.21.19] - 2025-02-03 From 6402f02321008256b8bcf178da1a38e1ff384170 Mon Sep 17 00:00:00 2001 From: Romain Lecouvreur <102067890+RomainLvr@users.noreply.github.com> Date: Thu, 20 Mar 2025 10:11:21 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md Co-authored-by: Stanislas --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38d16af6..e8fcfed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Fix containers migration while adding is_recursive field +- Fix containers migration while adding `is_recursive` field - Fix container update from other context (like plugins) - Fix "not equals" search operator for dropdown `multiple`