1

I was trying to delete a field from a content type . But it's deleting all the views which have that field in it.

I have some pages inside that view. I even checked in all the pages that this field is present , but not found.

Any idea to delete a field without deleting the whole view ??

enter image description here

2 Answers 2

4

As per the following issue registered on Drupal.org, that is what happening with D8 views hence you are observing that phenomenon. While in drupal 7 the view gets automatically updated. You can find the registered issue with drupal 8 core on drupal.org at following link.

When deleting a content type field, users do not realize the related View also is deleted

That issue is in review phase, hence probably significant work would have been done on that issue. You need to refer that.

If you read the entire discussion there, currently they are working on the idea of Comment #59. suggested by @dawehner which is stated/pasted below,

Here is alternative approach:

  • Don't delete existing views
  • Disable existing views and tell people which ones got disabled
  • Then the user can go back to this view, fix missing fields and call it a day
3
  • 1
    I had this same thing happen to me, but with Paragraphs. If you delete a Paragraph type which is being referenced by a paragraph field elsewhere, it will delete that field, regardless of if it holds other paragraph type references. There is work going on for that as well.
    – Kevin
    Dec 1, 2016 at 16:59
  • I have deleted the field from the view. And deleted the field , then also the view get deleted
    – KTM
    Dec 2, 2016 at 4:48
  • @IcecreamJelly, It should not delete, just now I did check in my trial site it is not deleting. Just remove the field whichever you do not want from the view and save that view, then delete that field from the content type. AGAIN, IF THAT FIELD IT USED IN ANYWAY IN THE VIEW, THE VIEW WILL GET DELETED, THAT FIELD SHOULD NOT BE USED IN ANYWAY, like if you remove it from the content, but if it is gets used in the FILTER or Contextual filter then also it is not completely removed and although you removed it from the content still it is getting utilized in view someway, Then also it ill delete.
    – CodeNext
    Dec 2, 2016 at 5:52
1

You must remove references to the field in the Views before deleting the field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.