File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
app/code/core/Mage/Eav/Model Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,23 @@ protected function _loadEntityTypes()
186
186
$ this ->_entityTypes = [];
187
187
$ this ->_entityTypeByCode = [];
188
188
$ entityTypeCollection = Mage::getResourceModel ('eav/entity_type_collection ' );
189
+
189
190
/** @var Mage_Eav_Model_Entity_Type $entityType */
190
191
foreach ($ entityTypeCollection as $ entityType ) {
192
+ // Ensure eav entity type model class is defined, otherwise skip processing it.
193
+ // This check prevents leftover eav_entity_type entries from disabled/removed modules creating errors and
194
+ // is necessary because the entire EAV model is now loaded eagerly for performance optimization.
195
+ $ entityModelClass = $ entityType ['entity_model ' ];
196
+ $ fqEntityModelClass = Mage::getConfig ()->getModelClassName ($ entityModelClass );
197
+ if (!class_exists ($ fqEntityModelClass )) {
198
+ if (Mage::getIsDeveloperMode ()) {
199
+ throw new Exception ('Failed loading of eav entity type because it does not exist: ' . $ entityModelClass );
200
+ } else {
201
+ Mage::log ('Skipped loading of eav entity type because it does not exist: ' . $ entityModelClass );
202
+ }
203
+ continue ;
204
+ }
205
+
191
206
$ this ->_entityTypes [$ entityType ->getId ()] = $ entityType ;
192
207
$ this ->_entityTypeByCode [$ entityType ->getEntityTypeCode ()] = $ entityType ;
193
208
}
You can’t perform that action at this time.
0 commit comments