Renaming fields in matrix blocks issue
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
There's a bug in matrix where renaming fields can get a mySQL error under specific circumstances. (possibly not restricted to matrix fields this but that's just where I've experienced it)
Steps to reproduce
- create a matrix field and add a block type
- create 2 plain text fields in the block, name one heading and one description and save the field
- edit the field and rename the first field to description and the second to anything else (rename the field handles too)
- the error is that the column matrix_blocktype__description exists already (which of course it does) however we're actually renaming that column too at the same time.
The workaround of course is to rename them one at a time to avoid this collision.
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
Reproduce the issue using the listed matrix-block steps, including swapping the two field names and handles in one save. Trace the field-renaming and database-column update entry points involved in that save. Done means the fields can be renamed simultaneously without a MySQL duplicate-column error, while sequential renaming remains unnecessary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100