(core) Fix error when updating summary table formulas after rename

Summary:
Formulas in summary tables were being associated with the source table for automatic updating. When a table/column was renamed such that the formula needed to update to match, it would look for a column with the same colId but in the source table. Such a column might not exist which would lead to an error, or if it existed then the update would be wrong.

This association was created while building formulas to display in the code view in a nested `_Summary` class, it didn't need to exist at all. So this diff simply prevents the association from being created.

User report and discussion: https://grist.slack.com/archives/C0234CPPXPA/p1659717322297019

Test Plan: Extended `TestSummary.test_table_rename` Python test.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3568
This commit is contained in:
Alex Hall
2022-08-08 15:37:25 +02:00
parent f215ec8b24
commit b416a5c4b1
3 changed files with 27 additions and 3 deletions

View File

@@ -350,7 +350,8 @@ def parse_grist_names(builder):
if not patch_source:
return None
in_text, in_value, in_patch = patch_source
return (in_value, in_patch.start, table_id, col_id)
if in_value:
return (in_value, in_patch.start, table_id, col_id)
parsed_names = []
for node in asttokens.util.walk(atok.tree):