From 8e65fd35a13fbb10d8b51fa5d399a7a5221ba378 Mon Sep 17 00:00:00 2001 From: Richard Kello Date: Tue, 25 Aug 2026 16:41:50 +0200 Subject: [PATCH 1/2] Fix photo naming expression returning NULL --- app/attributes/attributecontroller.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/attributes/attributecontroller.cpp b/app/attributes/attributecontroller.cpp index df1d5f38d..fa72b8483 100644 --- a/app/attributes/attributecontroller.cpp +++ b/app/attributes/attributecontroller.cpp @@ -1687,6 +1687,13 @@ void AttributeController::renamePhotos() InputUtils::sanitizePath( newName ); + if ( newName.trimmed().isEmpty() ) + { + CoreUtils::log( QStringLiteral( "Photo name format" ), QStringLiteral( "Expression for %1:%2 evaluated to an empty or NULL name, keeping the original file name" ).arg( mFeatureLayerPair.layer()->name(), field.name() ) ); + ++formItemsIterator; + continue; + } + const QFileInfo fi( src ); newName = QStringLiteral( "%1.%2" ).arg( newName, fi.suffix() ); From 9a47b572b3f001930cbe932c3c8b9e574e75bb1d Mon Sep 17 00:00:00 2001 From: Richard Kello Date: Tue, 8 Sep 2026 14:28:22 +0200 Subject: [PATCH 2/2] Update log message --- app/attributes/attributecontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/attributes/attributecontroller.cpp b/app/attributes/attributecontroller.cpp index fa72b8483..084944a5c 100644 --- a/app/attributes/attributecontroller.cpp +++ b/app/attributes/attributecontroller.cpp @@ -1689,7 +1689,7 @@ void AttributeController::renamePhotos() if ( newName.trimmed().isEmpty() ) { - CoreUtils::log( QStringLiteral( "Photo name format" ), QStringLiteral( "Expression for %1:%2 evaluated to an empty or NULL name, keeping the original file name" ).arg( mFeatureLayerPair.layer()->name(), field.name() ) ); + CoreUtils::log( QStringLiteral( "Photo name format" ), QStringLiteral( "Expression for layer %1, feature %2, field %3 evaluated to an empty or NULL name, keeping the original file name" ).arg( mFeatureLayerPair.layer()->name(), QString::number( mFeatureLayerPair.feature().id() ), field.name() ) ); ++formItemsIterator; continue; }