Problem/Motivation

Drupal core's check for uses of an entity bundle means that once you've cropped some images (e.g. with https://www.drupal.org/project/image_widget_crop/) then you can't delete the crop type.

Finding the crops to delete them is extremely difficult, and requires manual DB queries to find which entities the images are used in.

Could a UI be added to flush all crops of a particular type?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3228376-2-Cant-delete-a-crop-type.patch5.29 KBdrdam

Issue fork crop-3228376

Command icon 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

joachim created an issue. See original summary.

drdam’s picture

StatusFileSize
new5.29 KB

Hi,

I attache a patch which add a "flush action".

drdam’s picture

Status: Active » Needs review

nikolay shapovalov’s picture

Status: Needs review » Needs work

Thanks for your MR, please check my feedback.

drdam’s picture

Status: Needs work » Needs review

Fix reviews & add test

nikolay shapovalov’s picture

Status: Needs review » Needs work
Issue tags: +Need tests

Thanks for update, please check my feedback.

drdam’s picture

I have split the doTestFileUriAlter method in order to have "clean" code separation

drdam’s picture

Status: Needs work » Needs review
nikolay shapovalov’s picture

Status: Needs review » Needs work

Thanks, please check my feedback.

drdam changed the visibility of the branch 3228376-cant-delete-a to hidden.

drdam’s picture

Status: Needs work » Needs review
drdam’s picture

Status: Needs review » Reviewed & tested by the community
phenaproxima’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Need tests

I have a few relatively small suggestions. I think the test could be significantly cleaned up, as well, but that can be done later.

loze made their first commit to this issue’s fork.

loze’s picture

Status: Needs work » Needs review

Applied The code review suggestions and rebased, to help move this issue along.

Everything is passing. There is one warning for an unrelated issue.

phenaproxima’s picture

Title: Can't delete a crop type » Add a way to delete all crops of a specific type
Category: Bug report » Feature request

  • phenaproxima committed a63b59a5 on 8.x-2.x authored by drdam
    [#3228376] feat: Add a way to delete all crops of a specific type
    
    By:...
phenaproxima’s picture

Status: Needs review » Fixed

Merged into 8.x-2.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.