Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing fields or layouts in a more graceful manner #12

Closed
andris-sevcenko opened this issue Oct 31, 2019 · 2 comments
Closed

Handle missing fields or layouts in a more graceful manner #12

andris-sevcenko opened this issue Oct 31, 2019 · 2 comments

Comments

@andris-sevcenko
Copy link

There are scenarios where the plugin can leave the project config in a state that prevents importing into another site.

It seems that if, for example, a matrix block type gets deleted, the corresponding labels in the project config do not get removed, even though the field layouts no longer exist.
This leaves the project config in a state, where if you apply it to a different environment, a DB error will be thrown because of non-nullable columns.

The easiest way to hotfix this is to check if any of these calls return null, and, if so, skipping the (re)label.

@Anubarak
Copy link
Owner

Anubarak commented Oct 31, 2019

Thanks for reporting that, I'll of course fix it but Relabel doesn't even work for fields in a matrix. I don't reference fields that are in the field layout of matrix block types so I'm a little bit confused why deleting them should be a thing.

What I mean is: there are no corresponding labels for a matrix block type.

@andris-sevcenko
Copy link
Author

andris-sevcenko commented Oct 31, 2019

My bad, my then-context was just debugging a poject.yml file with a bunch of Matrix stuff. The same argument applies for a deleted entry-type, though where the field layout would get nuked.

Also, I'm not very smart when writing things on GitHub, so I should have clarified that it would not be the most common stumbling block for Relabel.

Anubarak pushed a commit that referenced this issue Apr 2, 2020
@Anubarak Anubarak closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants