When I tried to uninstall Scheduler via the UI and via Drush, both instances completely borked a number of content types.
Scheduling was disabled on all content types before uninstalling, but when I run the uninstall command, it leaves many content types without any fields!
(Lukily, I had everything exported via config management, so I didn't lose anything, but I can imagine someone without a backup getting really upset about it.)
All of the fields mentioned below do exist before running the uninstall. So, something during the uninstall process deletes them all. Eek!
I haven't had this issue with any other module, so I assumed it was specific to Scheduler, but if not, I'll happily repost in the appropriate location.
drush pm-uninstall -y scheduler 11:38:10
The following extensions will be uninstalled: scheduler
Do you really want to continue? (y/n): y
The Faculty bundle (entity type: node) was deleted. As a result, the field_principal_investigator entity reference field (entity_type: node, bundle: project) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
The Publication bundle (entity type: node) was deleted. As a result, the field_project_publications entity reference field (entity_type: node, bundle: project) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
The Faculty bundle (entity type: node) was deleted. As a result, the field_publication_faculty entity reference field (entity_type: node, bundle: publication) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
The Course bundle (entity type: node) was deleted. As a result, the field_study_abroad_course entity reference field (entity_type: node, bundle: study_abroad) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
The Faculty bundle (entity type: node) was deleted. As a result, the field_study_abroad_instructor entity reference field (entity_type: node, bundle: study_abroad) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
The Course bundle (entity type: node) was deleted. As a result, the field_program_curriculum_courses entity reference field (entity_type: paragraph, bundle: paragraph_curriculum) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted. [error]
scheduler was successfully uninstalled. [ok]| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2 uninstall scheduler with update commented out.png | 73.16 KB | jonathan1055 |
| #7 | 1 uninstall scheduler deletion warnings.png | 130.29 KB | jonathan1055 |
Comments
Comment #2
bjlewis2 commentedComment #3
bjlewis2 commentedComment #4
jonathan1055 commentedHi bjlewis2,
'eek' as you say, that's not good whoever caused it. Thanks for reporting it.
The scheduler uninstall function is very short:
So I am guessing that
->applyUpdates()method must be the cause of it. But Scheduler should only remove the two fields defined by Scheduler (obviously)If you have any ideas on where to start investigating, let me know.
Comment #5
bjlewis2 commentedJust wanted to post back on what I did to fix this. (Not really a fix, but a "how to get back to a working site without the Scheduler module."
That's what worked for me...
Comment #6
jonathan1055 commentedThanks for that. I have just tested and confirmed that custom fields are indeed deleted when Scheduler is uninstalled. This does seem strange. Upping the priority to major as this has to be fixed asap.
Comment #7
jonathan1055 commentedRepro steps:
The article content type now has no fields attached - the four core fields have been removed. As part of uninstalling we get the warning about config updates and deletes - see attached screen shot 1. The other content type, Page, is not affected - probably as it was not enabled for Scheduler (but that is a guess).
However, if you re-add a field to Article then repeat steps 2-4 above in the same site, without re-installing Drupal the fields are not deleted. [I thought this happened once, but now cannot repeat it]
Removing the line
from scheduler_uninstall() does not solve the problem - the fields are still removed. Although oddly the warning page is shorter and does not show the fields being removed (second screen shot).
Comment #8
mr.baileysComment #9
mr.baileysTalked with alexpott, swentel, aspilicious and gabor: seems like this is a core issue. If you disable the core menu_ui module (which also uses setThirdPartySettings()), this action will also incorrectly remove fields and other configuration.
Comment #10
jonathan1055 commentedThank You mr.baileys. My next step in debugging was going to see if other contrib modules caused this too, as it did not seem to be directly related to Scheduler code. Workbench Moderation has the same problem #2750405: Uninstalling workbench moderation delete fields attached to the entity on which workbench moderation have been enabled. If it is a core problem then I will look out for the issue and be happy to contribute testing or whatever.
Jonathan
Comment #11
swentel commentedIt is a core issue, critical issue coming up in a moment.
Comment #12
swentel commentedSee #2754477: Unexpected config entity delete due to dependency calculations
Comment #13
jonathan1055 commentedThanks for the link to the core issue, I am following it with interest.
I have set the status here back to 'active' so that it appears in dashboards, issue lists and is easier for other users to search and find, so that we do not get duplicated issues. I will close this again when the core issue is resolved.
Comment #14
jonathan1055 commentedJust to confirm, this issue is fixed by #2754477: Unexpected config entity delete due to dependency calculations. Setting to postponed, and will close when the core change it committed.
Comment #15
jonathan1055 commentedClosed now that #2754477: Unexpected config entity delete due to dependency calculations has been committed to core 8.2 and 8.1