Skip to content

Commit a441a19

Browse files
RomainLvrstonebuzz
andauthored
Fix containers migration while adding is_recursive field (#919)
* Fix containers migration while adding is_recursive field * Update CHANGELOG * Update CHANGELOG.md Co-authored-by: Stanislas <[email protected]> --------- Co-authored-by: Stanislas <[email protected]>
1 parent 5af8b09 commit a441a19

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Fixed
1111

12+
- Fix containers migration while adding `is_recursive` field
1213
- Fix container update from other context (like plugins)
1314
- Fix "not equals" search operator for dropdown `multiple`
1415

templates/container.class.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ class %%CLASSNAME%% extends PluginFieldsAbstractContainerInstance
106106
* This block ensures that the 'is_recursive' field is created and populated if it
107107
* associated item type requires recursive assignment
108108
*/
109-
if (getItemForItemtype("%%ITEMTYPE%%")->maybeRecursive() && !$DB->fieldExists($table, 'is_recursive')) {
109+
if (
110+
getItemForItemtype("%%ITEMTYPE%%")->maybeRecursive()
111+
&& !$DB->fieldExists($table, 'is_recursive')
112+
&& $DB->fieldExists($table, 'entities_id')) {
110113
$migration->addField($table, 'is_recursive', 'bool', ['after' => 'entities_id']);
111114
$migration->addKey($table, 'is_recursive');
112115
$migration->executeMigration();

0 commit comments

Comments
 (0)