Skip to content

[5.x]: Adding column to existing Table with Static Rows deletes its values #18764

@foxtrotcz

Description

@foxtrotcz

What happened?

Description

If you created Table with Static Rows, inserted data and later want to add another column it deletes the data.
The problem is RowId gets changed in the field yaml file which breaks connection to data in DB.

Steps to reproduce

  1. Create Table with Static Rows.
  2. Fill it with some data in Entry and save it.
  3. Back in field config add another column and save.
  4. Check the entry and see that data disappeared.

You can get you data back by disabling Static Rows. If reenabled it disappears again.

There is also strange workaround:

  1. Disable Static Rows to get data back.
  2. In Entry change something in the Table and save.
  3. Reenable Static Rows
  4. Data stays

Expected behavior

I would expect for RowId to stay the same and already existing data stay visible.

Actual behavior

Data disappear.

Craft CMS version

Craft Solo 5.9.21

PHP version

8.4.20

Operating system and version

Linux 6.8.0-110-generic

Database type and version

MySQL 8.4.5

Image driver and version

Imagick 3.8.1 (ImageMagick 7.1.1-43)

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions