When deleting a relation type, the following seems to happen:

* Any relation entities of that type are kept.
* The end points in that relation appears to be lost.

When recreating a relation type with the same settings and machine name, the end points don't reappear.

(I was expecting that all relations of the deleted type would be deleted as well, but I guess this behaviour is consistent with what happens when you delete node types. However, nodes keep their information even when their node types are deleted – right?)

I don't know if this should be considered a bug or not, but it was certainly unexpected.

PS: Recording screencasts seems to be a good way to find bugs.

Comments

naught101’s picture

Not sure about the preferred behaviour here, but yes, either everything should be deleted, or everything kept.

blainelang’s picture

Just wanted to note that this is still an issue: Deleting the relation does not delete the relation records and if you create a new relation of the same name then use a view or access 'Relations' from view content, you will get Notice errors.

mikran’s picture

Component: Code » API
Issue tags: +7.x-1.0 blocker
mikran’s picture

Assigned: Unassigned » mikran
mikran’s picture

Status: Active » Needs review
StatusFileSize
new2.07 KB

The attached patch mimics the way how content types are handled on deletion. All fields are kept and admin content list shows endpoints separated by ',' as it's not known whether relation type was directional or not.

mikran’s picture

StatusFileSize
new2.09 KB

Oops, wrong entity to check directional attribute

mikran’s picture

Status: Needs review » Fixed

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