(core) Fix bug where duplicating a table would cause an error when a column had mismatching label and colId

Test Plan: Added a test case to trigger this situation.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3832
This commit is contained in:
Dmitry S
2023-03-23 20:21:38 -04:00
parent d29770511c
commit 361af238cc
2 changed files with 19 additions and 0 deletions

View File

@@ -1904,6 +1904,7 @@ class UserActions(object):
type=new_type,
visibleCol=new_visible_col,
untieColIdFromLabel=existing_column.untieColIdFromLabel,
colId=new_column.colId, # To ensure untieColIdFromLabel doesn't rename this column.
recalcWhen=existing_column.recalcWhen,
recalcDeps=new_recalc_deps,
formula=formula_updates.get(new_column, existing_column.formula),