Skip to content

Conversation

@davidhiendl
Copy link
Contributor

@davidhiendl davidhiendl commented Jun 20, 2023

A fix for #3175 ensuring that the eav entity type class is present before proceeding to load it to gracefully handle removed modules and/or leftover data.

Purposely throws exception in developer mode to highlight the leftover data and only logs a statement once every time data is loaded from the database.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Disable eav cache
  2. Add entry to eav_entity_type table with non-existent model class

@github-actions github-actions bot added the Component: Eav Relates to Mage_Eav label Jun 20, 2023
@davidhiendl
Copy link
Contributor Author

davidhiendl commented Jun 20, 2023

Please note I only "fixed" the issue caused by eager loading of entity types, eager loading of attributes with non-existent models always caused issues in the past as well (eg. deleting a module with a class that was used as custom attribute source_model or frontend/backend type model always caused issues in the past, removing those checks would be quite extensive and I at least prefer to be warned "early" of such issues).

@elidrissidev elidrissidev linked an issue Jun 20, 2023 that may be closed by this pull request
@elidrissidev elidrissidev requested a review from sreichel June 20, 2023 10:17
@davidhiendl davidhiendl requested a review from addison74 June 20, 2023 14:41
@fballiano fballiano requested a review from addison74 June 20, 2023 20:51
@sreichel
Copy link
Contributor

Accidentally deleted all my VBox images and had no time to recreate.

Can't test it during next days.

@addison74
Copy link
Contributor

@sven - I will make time these days to simulate your case. DDEV in my case requests only a couple of minutes to run an OM instance from scratch. I will install an extension then delete it from the file system. I should get your error, then I checkout this PR to see what happens. Do I need to take other steps to reproduce the issue?

@sreichel
Copy link
Contributor

@addison74 thanks. I know it takes only minutes to setup OM, but I've to do some more things. Need a new HDD, update my whole system from Win7 (do not laugh 😂), but the most important ... my beloved dog is 9y now and I just want to spend as much time as possible with her.

To reproduce ... install the extension you sent me and remove all files. No further steps.

@davidhiendl
Copy link
Contributor Author

davidhiendl commented Jun 22, 2023

It's much easier to simple insert a new entry into the eav_entity_type table with a non-existent model class.
(I did not actually install whatever extension caused the issue, because I don't have it but the exception clearly pointed to this. With the entity loading skipped it will also skip all attributes associated with that entity.)

@addison74
Copy link
Contributor

I confirm this PR solves the issue reported here #3175.

@fballiano fballiano changed the title fix eav_config_entity throwing error message on removed entity model Fixed eav_config_entity throwing error message on removed entity model Jun 25, 2023
@fballiano fballiano merged commit 97e200d into OpenMage:main Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Eav Relates to Mage_Eav

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't retrieve entity config (after delete extension)

4 participants