Changing a field from Matrix to another fieldtype orphans the matrix table and elements
Open
Nobody has claimed this yet.
bug
severity:normal
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
I switched a matrix field to a plaintext field (I was actually trying to switch the field because the matrix field wouldn't delete, but that's another story).
I ended up deleting the field as a plaintext field and the matrix table did not delete.
I tried re-creating the field as a matrix and deleting again and the table is still there.
Steps to reproduce
- Create a Matrix field.
- Switch the Matrix field to a Plaintext field.
- Check the database, the matrix table and elements still exist in the database.
Additional info
- Craft version: 3.2.8
- PHP version: 7.2
- Database driver & version: Maria DB
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the report. Reproduce the three listed steps on Craft 3.2.8 with MariaDB, then check the database as described; done means changing a Matrix field to Plaintext no longer leaves the Matrix table or elements behind.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100