Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
6 Nov 2015 at 03:08 UTC
Updated:
1 Dec 2022 at 14:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Todd Young commentedSome more info: I deleted *ALL* the content on the site. I was left with three files that were in File Fields in paragraphs, even though the paragraph types were deleted, as well as all nodes and node types. Looks like these three files are stuck in some orphaned paragraphs, and I have no "legit" interface to delete the files so I might have to get hacky with removing these associated files and the paragraphs themselves.
Comment #3
jeroen.b commentedYeah, you probably have to delete those manually from the file usage.
Can you create a followup issue about the issue that file usage isn't correct after deleting paragraphs?
Comment #4
Todd Young commented#2611940: File Usage information incorrect after deleting/removing paragraphs - Thanks for the attention!
Comment #5
bcobin commentedI have the same issue as far as being unable to uninstall is concerned, but there are no orphaned files anywhere. I'm just testing out D8 at this point - is there anything I can do other than reinstalling Drupal? Thanks...
Comment #6
sdmeyers commentedI've had to do this a couple of times. Through trial and error this is what worked for me...
1. Remove all Paragraphs types.
2. Make sure you are not using any Paragraph fields in any content or content types.
3. browser your Drupal database and delete all the rows from the Paragraphs tables:
-
paragraphs_item-
paragraphs_item_field_data-
paragraphs_item_revision-
paragraphs_item_revision_field_dataDon't just drop the tables or bad things will happen
4. You should now be able to uninstall the module normally.
Comment #7
zuernbernhard commentedShouldn't the Module itself offer a posibillity to truncate the data from the backend ?
Comment #8
fkelly12054@gmail.com commentedsdmeyers, thank you! Just used phpmyadmin to truncate the four tables you listed, then could uninstall paragraphs. Now status report comes up clean. Agree with comment that module should give option to truncate the tables if someone really wants to uninstall.
Comment #9
miro_dietikerFor other modules such as Simplenews, we created some special admin UI button to prepare uninstall (=data deletion).
Simplenews example: #2418659: Can not uninstall: "Fields type(s) in use"
The origination is a known Core limitation and that's just a temporary workaround.
Comment #10
tduong commentedStarting codes: just added a settings page where you can find the "Prepare uninstall" page (similar to Simplenews example).
Tested manually and it works fine.
Here we don't specify for paragraph types/fields (like it is done in Simplenews, specified for Subscriber), because they are different scenarios (Simplenews provides contents and fields, while Paragraphs just provides contents, fields are provided by Entity Reference Revisions).
As @miro_dietiker has already mentioned, for now we can have this thing in admin/structure/paragraphs_type/settings/uninstall for Paragraphs, but instead of adding/keeping the N-th workaround in Contrib, we will have this kind of functionality in Core, so when you want to uninstall a module that have other dependencies, it will show you these informations and ask you to confirm to delete them as well on the same uninstall process without any trouble. This is already discussed long time ago, but AFAIK nobody has created the issue yet.
Comment #11
tduong commentedTest coverage: tomorrow ;)
Comment #12
tduong commentedOk, actually there a a bunch of issues for that, but have different points of view: https://www.drupal.org/project/issues/drupal?text=uninstall
Not sure how we will manage it, but sure it will take long until it will be in Core. For now, for Paragraphs I guess is fine as I've shown in the previous comment. I'll upload the test soon!
Comment #13
tduong commentedHere we go: test_only = interdiff.
Comment #20
tduong commentedDiscussed with @Berdir and created Core issue for our case (entity types): #2688945: Allow removing a module's content entities prior to module uninstallation
Comment #21
berdirThat's the wrong class...
Just add a single local task directly to prepare uninstall, no need for settings and prepare uninstall
that's the wrong base class.
Comment #22
tduong commentedDone.
Comment #23
tduong commentedNew UI.
Comment #27
miro_dietikerCommitted this.
Some people might not like the tab, but we need it in the current situation.
Comment #29
miro_dietikerUpdating again an inconsistent state.
Comment #31
geru commentedI have run into this same issue.
Between deleting all of my paragraphs types and paragraphs content types and also having the module prepare for uninstall, all of the paragraphs_item* tables were emptied.
I could not uncheck the paragraphs modules in the Extend admin interface in order to uninstall them.
Drush pm-uninstall worked until I reached the entity_reference_revisions module. On that one, drush balked with a field deletion error:
Drupal\Core\Extension\ModuleUninstallValidatorException: The following reasons prevent the modules [error]
from being uninstalled: Fields pending deletion in...
In PHPmyadmin, I found search_api_db_paragraphs_demo_index* tables from my experimentation, so I deleted them, but the uninstall still doesn't work. I'm leaving it for now. Perhaps it is an entity_reference_revisions problem.
Comment #32
johnchque@geru can you write the whole exception message please? That could be really helpful to see what is the problem.
Comment #33
geru commentedI just did a fresh D8 install. I successfully installed and uninstalled Paragraphs. I also installed and uninstalled Paragraphs_demo.
When I try to uninstall entity_reference_revisions using drush, I get the following message:
Comment #34
berdirYou need to run cron, possibly multiple times (if you had a lot of data) until it it purges all the data in that field.
Deleting a field doesn't immediately delete all data, if you check your database, you'll see a new table that has a hash in it. You need to run cron until that table gets removed, basically.
Comment #35
geru commentedAll I did was to enable the Paragraphs and Paragraphs Demo modules and then uninstall them.
The Paragraphs Demo module created content that remained after I had uninstalled the demo. I deleted that piece of content so there is no content at all in this test installation.
Running cron gives an error message indicating that the paragraph entity was not completely deleted.
It's not clear to me that running cron more times will change anything and the behavior when trying to uninstall entity_reference_revisions remains the same.
Comment #36
Benia commentedI typed "drush cron" 10 times and still can't remove Entity reference revisions.
Comment #37
dqdSorry for chiming in here but: I am even not able to delete a paragraph type. Even after deleting all content and all fields in the type and running drush cr, drush cron and drush up about 40 times ... (8.x-1.1+85-dev)
Comment #38
bcobin commentedI get the same error and this is on a "clean" site, where everything was up to date when I installed and uninstalled... theoretically. I'm running 9.4.8.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "paragraph" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of [site]/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).If you try to remove a field, you get the error. Nasty. I have a hunch this has to do with the Paragraph Demo, nor Paragraphs per se.
It's been over five years - has anyone found a solution here? A search for "paragraph" in phpMyAdmin shows entries in the following tables:
cachtags
cache_config
cache_default
config
field_deleted_data
field_deleted_revision
key_value
To reproduce, create a field in a content type. Then delete it and you'll get the error.
Can anyone provide some guidance as to what I can do to fix this? I don't want to bork the site. Thanks in advance for any guidance...