Problem/Motivation

Installed the module, then immediately decided I actually didn't need it on the current project, attempted `drush pm-uninstall paragraph_view_mode` but received the following message.

paragraph_view_mode: The Paragraph view mode field type is used in the following field: paragraph.paragraph_view_mode

Steps to reproduce

composer require drupal/paragraph_view_mode
drush en paragraph_view_mode
drush pm-uninstall paragraph_view_mode

Proposed resolution

Provide an uninstall hook to delete the field.

Remaining tasks

Patch?

User interface changes

N/A

API changes

Just an uninstall hook, I think.

Data model changes

N/A

Comments

scottsawyer created an issue. See original summary.

scottsawyer’s picture

In case anyone runs into this problem, what you need to do is delete the field storage.
drush cdel field.storage.paragraph.paragraph_view_mode

The issue should be left open until such time as a proper uninstall function is created. I looked at the install, which uses the field storage manager, so I imagine that for consistency, it should probably have a new method to delete the field storage.

sayco’s picture

Hi, thanks for reporting. I'm not sure if I understood correctly, but I belive that everything is as it should.
The module shouldn't delete any field storage as long as the field is in use in some paragraph types. I would imagine the case in which we will force to remove the storage on uninstall and someone will go over here and complain because of the data loss.
I always thought that the correct way is to delete the fields manually (user must know that it will wipe the data and so on), then once it won't be in use it can be uninstalled without any issue I suppose?
I'll keep the ticket open though, we will see what are the community opinions on that matter.

sayco’s picture

Status: Active » Postponed (maintainer needs more info)
sayco’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)