From fa9cc6bc8c7046816947147384c9a9f8bd98659f Mon Sep 17 00:00:00 2001 From: L2D2Grafana Date: Fri, 12 Dec 2025 09:51:04 -0800 Subject: [PATCH] Logs: only run the url migration if columns are present --- public/app/features/explore/Logs/utils/columnMigration.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/public/app/features/explore/Logs/utils/columnMigration.ts b/public/app/features/explore/Logs/utils/columnMigration.ts index 91658925f0d..8be83f4f810 100644 --- a/public/app/features/explore/Logs/utils/columnMigration.ts +++ b/public/app/features/explore/Logs/utils/columnMigration.ts @@ -145,18 +145,14 @@ export function migrateLegacyColumns( defaultDisplayedFields: string[], visualisationType?: string ): string[] | null { - console.log('logsState', logsState); // Ensure logsState is an object - if (!logsState || typeof logsState !== 'object') { + // Only run this migration if legacy columns are present + if (!logsState || typeof logsState !== 'object' || !hasLegacyColumns(logsState)) { return null; } // For table visualization: only use columns from URL and map the old field names to the new ones if (visualisationType === 'table') { - if (!hasLegacyColumns(logsState)) { - return null; - } - const columnsValue = extractColumnsValue(logsState); const parsedColumns = parseLegacyColumns(columnsValue);