mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Renaming table linked by summary table resulted in error
Summary: When a table was selected by a summary table, renaming that table using section widget resulted in a javascript error. Test Plan: new test Reviewers: alexmojaki Reviewed By: alexmojaki Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3475
This commit is contained in:
parent
1c89d08ea3
commit
64d9ecacdb
@ -335,7 +335,11 @@ export function getFilterFunc(docData: DocData, query: ClientQuery): RowFilterFu
|
||||
* rowIds), and consistently sorted. We use that to identify a Query across table/column renames.
|
||||
*/
|
||||
function convertQueryToRefs(docModel: DocModel, query: ClientQuery): QueryRefs {
|
||||
const tableRec: any = docModel.dataTables[query.tableId].tableMetaRow;
|
||||
// During table rename, we can be referencing old name of a table.
|
||||
const tableRec = Object.values(docModel.dataTables).find(t => t.tableData.tableId === query.tableId)?.tableMetaRow;
|
||||
if (!tableRec) {
|
||||
throw new Error(`Table ${query.tableId} not found`);
|
||||
}
|
||||
|
||||
const colRefsByColId: {[colId: string]: ColRef} = {id: 'id'};
|
||||
for (const col of tableRec.columns.peek().peek()) {
|
||||
|
Loading…
Reference in New Issue
Block a user