diff --git a/CHANGELOG.md b/CHANGELOG.md index de3ef73c..e8fcfed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fix containers migration while adding `is_recursive` field - Fix container update from other context (like plugins) - Fix "not equals" search operator for dropdown `multiple` 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();