- Issue created by @s-jack
- ๐ฏ๐ตJapan s-jack Tokyo
Just to be sure, the following tasks were verified.
- Tried to delete all content that uses paragraphs, but the fields cannot be deleted and the module cannot be uninstalled.
- Tried to delete all content types that use paragraph types, but the fields cannot be deleted and the module cannot be uninstalled.
- Tried to delete all paragraph types, but fields cannot be deleted and the module cannot be uninstalled.
It is odd that the module cannot be uninstalled because the field is assumed to be in use, even though everything using the paragraph has been removed.
Is the only possibility left to remove the other paragraph-related modules themselves?
- ๐ฏ๐ตJapan s-jack Tokyo
Uninstalled and verified the modules related to paragraphs.
- Paragraphs Editor Enhancements module uninstalled.
- The Paragraphs Features module was uninstalled.
To my surprise, the remaining two Paragraphs and Paragraph View Mode modules are interdependent and neither can be removed.
This seems to be a bug.
- ๐ฏ๐ตJapan s-jack Tokyo
Created a new clean site test environment.
Installed only Paragraphs 8.x-1.17 and Paragraph View Mode 3.1.3 modules.
I did not create any content using paragraphs or paragraph types, only modules were installed.
The Paragraph View Mode module cannot be uninstalled.
Therefore, the module also cannot be uninstalled due to dependencies. - First commit to issue fork.
- Merge request !8Added a config route to delete paragraph_view_mode field storage โ (Open) created by sathishdevan
- ๐ฎ๐ณIndia sathishdevan
Hi Jack,
The paragraph_view_mode field is created on the installation process and that blocks the uninstallation of the module. I have a create a path from where you can delete the field and then you should be able to uninstall the module.
- ๐ฏ๐ตJapan s-jack Tokyo
Hi sathishdevan.
I am a user with a level of interest in basic programming, so I do not understand the detailed specifications.
I assume that fields are reusable when they are placed in concrete bundles.โจBut are you saying that the fields in this module are created internally without placing them in a bundle?
If so, then the fact that fields cannot be deleted is a specification and not a bug.
However, from the user's perspective, it is very inconvenient to not be able to uninstall without special work.What exactly do you mean by "if you create a path to delete a field?"
- ๐ฎ๐ณIndia sathishdevan
Hi Jack,
I have created patch for this uninstall issue.
This patch will create a new route. If you navigate to this route /admin/config/content/paragraph-view-mode-delete, you will have provision to delete the field which is created by the module and then you can uninstall the module.
- Status changed to Needs review
6 months ago 10:15am 13 May 2024 - Status changed to Postponed: needs info
6 months ago 8:48pm 13 May 2024 - ๐ต๐ฑPoland sayco Toruล
Hi, thanks for reporting.
It seems to be indeed the issue.
One very simple workaround for this is to add a paragraph field to any paragraph type and then remove it.
It will trigger the internal Drupal logic to remove the field storage if the field is no longer used in any entity (see video attached).I don't think that what was proposed in a patch makes sense, to be honest.
The code is correct, but I don't think we need this complex solution for a simple issue.
The original issue is that on hook_install the field storage is created, but it should be created "on the fly" when creating the field.
So to fix the issue permanently, the hook_install has just to be removed. - Status changed to Fixed
6 months ago 8:59pm 13 May 2024 - ๐ต๐ฑPoland sayco Toruล
I just pushed the change by removing the hook install to a dev branch.
This will, of course, won't help your issue (only the workaround I mentioned will help you),
but this will prevent future installations from falling into the same issue.I consider the issue fixed, and for future reference I'll paste again the workaround:
One very simple workaround for this is to add a paragraph field to any paragraph type and then remove it.
- ๐ฏ๐ตJapan s-jack Tokyo
Hi sathishdevan and sayco.
I had not yet applied the patch to check it, but once I placed the field in the paragraph type and immediately removed it, I confirmed that the module can be uninstalled.
Thank you for pushing the patch. Automatically closed - issue fixed for 2 weeks with no activity.