Skip to content

Commit b31e332

Browse files
committed
Only show warning if the localized dataset is not present
Actually this is not working fine in QFieldSync now, because the `bad_layer_handler` is not set, due to crashes of QGIS. At least we prevent a warning that the layer will not be packaged, while it will be in the cloud environment.
1 parent 6b466b3 commit b31e332

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libqfieldsync/layer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,9 @@ def package_prevention_reasons(
929929
if not self.is_supported:
930930
reasons.append(LayerSource.PackagePreventionReason.UNSUPPORTED_DATASOURCE)
931931

932-
# do not package the layers within localized paths (stored outside project dir and shared among multiple projects)
933-
if self.is_localized_path:
932+
# The layer is invalid and it is a localized datasource.
933+
# The project is available locally, but the localized dataset is not found in the localized datasets, probably not downloaded yet.
934+
if not self.layer.isValid() and self.is_localized_path:
934935
reasons.append(LayerSource.PackagePreventionReason.LOCALIZED_PATH)
935936
# sometimes the remote layers are inaccessible from the current network, but we should spare them from removal
936937
elif not self.layer.isValid() and self.is_remote_raster_layer:

0 commit comments

Comments
 (0)