Early Bird Registration for DrupalCon Atlanta is now open! By registering during our Early Bird Registration window, you’ll save $100. This window ends on 19 January 2025 and will go by quickly, so don’t wait!
Problem/Motivation
The SchedulerManager::entityRevert
method seem to expect that the entity type has a bundle class.
For me all config imports are failing with The "" entity type does not exist.
. While debugging I found that it's related to the entityRevert method in the scheduler module, that in my case tries to revert the entity type mailchimp_campaign
. This entity type has no bundles (and no bundle class).
Therefore it's passing NULL in the following code snippet https://git.drupalcode.org/project/scheduler/-/blob/2.x/src/SchedulerMan...
foreach ($this->entityTypeManager->getStorage($bundleType)->loadMultiple() as $bundle) {
This leads to the exception.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | scheduler-fails_on_entity_types_without_bundles-3373860-2.patch | 584 bytes | szeidler |
Issue fork scheduler-3373860
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedHere's a workaround for the issue that just skips all entity types that do not have bundles.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks for reporting this szeidler, and for doing the debugging and providing the precise cause. Just for my info, did you find this problem when upgrading to Scheduler 2.0.0 from 8.x-1.n or have you upgraded from an earlier 2.x version?
Comment #6
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedThe sites affected, have been based upon Thunder, so went the whole way from 8.x-1.x to 2.0.0
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks. This was added the most recent commit before 2.0.0 on #3336108: Don't run hook_modules_installed during config install
I'd be happy to commit this, and then release 2.0.1 as it seems quite a major error.
Comment #8
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI just noticed that it actually is influenced by another pending entity update. So in my use-case there was a pending entity update on that
mailchimp_campaign
entity type (which has no bundles) and since in Scheduler we retrieve all pending entity updatesit leads to the error. Means the problem happens
Since database updates should always run before doing a
drush config:import
, the problem only occurs if something with the entity update (caused by another module or custom code) went wrong and the error we see here is a side-effect of it.Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks. This entityRevert function should not have been called during config import, that was an error and I have have removed it in the second commit. The only other places this function is callled are
(a) via a specific hook update where the parameter of 'paragraph' is passed, which means any other entity with a pending change will be ignored
(b) In scheduler's own hook_uninstall() ie when Scheduler is being uninstalled
(c) via
drush scheduler:entity-revert
If you are happy with the change, and it fixes your problem, can you mark this RTBC, then I will commit and release 2.0.1
Comment #10
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedFrom my side this looks good. Disclaimer: I haven't followed why it was introduced in the first place.
Even though my issue occurs only, if something else is off (in my case missing/wrong entity updates). This fix will not block any config import in such a scenario. That's good.
Comment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI raised the question in #3336108-12: Don't run hook_modules_installed during config install and thought it was wrong to add it during the altered import steps, as it was not part of the original import process. I should have stuck to my hunch and removed it before committing.
Thanks for RTBC. Merged and fixed.
Comment #13
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have now released Scheduler 2.0.1