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

Issue when updating a block type handle #3809

Closed
carlcs opened this issue Feb 8, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@carlcs
Copy link
Contributor

commented Feb 8, 2019

Description

All content gone after updating the handle of a Matrix block type.

Steps to reproduce

  1. Create a Matrix field with one block type with handle foo, that has a plain text field with handle text
  2. Add the field to some element field layout and create an element with a foo block added with some text entered.
  3. Edit the Matrix field settings and chage the block type’s handle to bar
  4. Open the previously created element and see how content is gone
  5. Inspect whats going on in the database and see how there’s now two columns in matrixcontent_foo for our text field.

Additional info

  • Craft version: 3.1.8
  • Database driver & version: MySQL
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Feb 12, 2019

Just fixed this for the next release. Unfortunately it’s not possible for us to write a migration to patch up your content, though, as we don’t keep records of Matrix block types’ handle changes once they’ve been saved.

So to patch your content manually, you will need to look through your matrixcontent_X table and manually copy values over from the old column to the new one (or write a SQL query to do it). If you haven’t made any new content changes since renaming the block type, you could also just rename your block type handle back to the original value, before updating to the next release (3.1.9), and the content will be restored.

@carlcs

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2019

No worries, it’s a site in development without any real content yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.