From e5c3e542271f0cc24b923c21420a9b7fca068096 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 28 Aug 2026 16:39:16 +0200 Subject: [PATCH] #14538 Well path: Preserve renamed file well name without breaking legacy projects Reverts the unconditional change from commit 74ffc822f2 and replaces it with a safer fix: only skip re-initializing the well path name from the source file on reload when a name has already been set. Older projects that never serialized the well path Name field (e.g. TestCase_RFT_PLT/RegressionTest.rsp) still get their name populated from the file on load, while renamed well paths in newer projects keep their custom name across reloads. Restores the RMS well round-trip test that verifies a renamed well path name persists after save/reopen. --- .../ProjectDataModel/WellPath/RimFileWellPath.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp index e1f5921557..c26fd55d89 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp @@ -138,8 +138,12 @@ bool RimFileWellPath::readWellPathFile( QString* errorMessage, RifWellPathImport RifWellPathImporter::WellMetaData wellMetaData = RifWellPathImporter::readWellMetaData( filePath(), m_wellPathIndexInFile() ); // General well info - if ( initializeWellNamesFromFile ) + if ( initializeWellNamesFromFile || name().isEmpty() ) { + // Initialize the well path and export names from the source file during first import, or if no name + // has been assigned yet (e.g. projects saved before the well path name was persisted). Subsequent data + // reloads of a named well path preserve the name stored in the project while continuing to refresh + // geometry and metadata. setName( wellData.m_name ); }