Ineffective event handling in DictionaryMetaFieldManager
Jan 16 2019
Feb 18 2019
Closed, Fixed and tested
DictionaryMetaFieldManager will try to load all metaclasses when a metafield is changed (linked/unlinked/updated), so it can update the list of dictionary type metafields. However, this is far from perfect:
- A metafield is linked
- GetCatalogMetaClasses is called, which calls to MetaClass.GetList
- Inside MetaClass.GetList, for each metaclass, HandleRequiredFields is called, which effectively calls metaClass.AddFields multiple times.
- AddFields will raise RaiseMetaFieldLinked event again.
In the end, MetaDataPlusDatabase.LoadMetaClassListByNamespace will be called many times (thousands or more).