Jumoo / uSyncMigrations

Rough and ready migration code.
Mozilla Public License 2.0
44 stars 58 forks source link

Fix: iterate through all composition levels to find editor alias #206

Closed jhenkes closed 1 year ago

jhenkes commented 1 year ago

In my migration, we're inheriting 2 levels deep of contenttype, e.g.: BaseContentType (= Level 1) -> ChildContentType (= Level 2) -> ChildChildContentType (= Level 3)

The composition structure looks identical in this case. If "BaseContentType" defines property "BaseA" and "ChildChildContentType" inherits "BaseA", the current code looks up the editor alias for the compositions of "ChildChildContentType" (which only includes ChildContentType) and stops there if it can't find it. It should be going further, since the alias can be found in "BaseContentType".

The fix basically travels through all composition levels until it can find the editor alias in any parent/sibling or no compositions are left to search through.