Needs work
Project:
Drupal core
Version:
main
Component:
field system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
27 Feb 2015 at 14:05 UTC
Updated:
3 Jun 2025 at 15:27 UTC
Jump to comment: Most recent, Most recent file
This issue is follow up of a suggestion given in Delete dependent config entities that don't implement onDependencyRemoval() when a config entity is deleted.
The main motivation is that API for deletion of field should not be responsible for deletion of the field storage. It should do only what the API method says that it will do and nothing more.
The code responsible to delete the field storage when the last field is deleted will be moved in the UI.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2442757-field-delete-dependency-13.patch | 9.73 KB | berdir |
Comments
Comment #1
boyan.borisov commentedComment #2
boyan.borisov commentedComment #3
boyan.borisov commentedComment #4
boyan.borisov commentedI've created a patch.
Comment #6
boyan.borisov commentedIt seems that I've missed to update a few tests which check exactly what we are trying to change.
Comment #8
boyan.borisov commentedand one more try
Comment #9
swentel commentedexceeds 80 chars
I think we can remove the '!$this->entity->isUninstalling()' part
Comment #10
lanchez commentedMade those alterations.
Comment #11
berdirAs discussed at the sprint at Barcelona, this is the critical part of #2468045: When deleting a content type field, users do not realize the related View also is deleted, we need this to be able to show if a field storage will be deleted, so that we can show that the view will be deleted.
Comment #12
berdirThe patch is a good start, but to actually make this work, we need tests for that behavior and more importantly, we need to be able to show the dependencies that will be affected by deleting the storage together with the field dependencies.
Comment #13
berdirGoing to work on this.
Comment #14
berdirSorry @Bojhan :)
Comment #15
berdirFirst part, this provides the UI dependency information in the UI.
Remaining steps:
1. Write tests for this, going to be a bit complicated I fear, I need a view or something else that depends on the storage, a number of combinations
2. It now shows the field itself as a dependency that will be deleted, which is correct for the storage, but we obviously know that. Going to try and hide that.
I think I also incorrectly merged one part but I think we are removing too many tests anyway.
Comment #16
Jaesin commented@Berdir++
Comment #17
yched commentedSo you said we could also leave the deletion at the API level rather than at the UI level ? If so, I'd rather be +1 on that ?
Minor : should we leave that as a parent:: call ?
Comment #19
berdirYes. Which is why I created a new issue: #2575605: Field delete form does not display configuration dependencies that will be updated/deleted
Comment #21
Bojhan commented@Berdid Haha :) I was already wondering what the UI aspect here was.
Comment #35
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #36
andypostthe same time core (field ui) still has no UI to even know that there's any field's table and definition exists...
Moreover body field for node/comment is created automagically
Comment #37
andypostPatch #15 is totally ok to convert to MR and add tests, it brings visibility at least