(dev/core#3496) Missing extension leads to bootstrap error for "hook_civicrm_entityTypes" #23716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
If you attempt to load CiviCRM 5.50 on a site with a missing/badly-uninstalled extension, then it crashes.
See also: https://lab.civicrm.org/dev/core/-/issues/3496
(This PR is against 5.50-stable. For 5.51+, see #23718.)
Steps to reproduce
Before
All page-loads fail due to unhandled exception:
After
CiviCRM is able to continue running. Of course, you should disable the missing extension completely.
Technical Details
The discussion on Stackexchange/Gitlab highlights the presence of
civicrm_entity
; however, I think this is incidental. I installed on D9/Civi 5.49/civicrm_entity and then upgraded to Civi 5.50 -- and did not encounter the problem. Additionally, one commenter mentioned a similar problem on WordPress (which means they don't havecivicrm_entity
). So I don't think it's causal -- but havingcivicrm_entity
might amplify the problem (eg because it boots Civi more often).There are two interesting backtraces - one is a screenshot from the Gitlab issue, and the other was pasted into MM by @mattwire. There's a common element in both. Here's an annotated excerpt from Matt's:
So I was able to reproduce by the error by deleting an active extension.