Skip to content

Fix localized dataset processing#746

Merged
toebivankenoebi merged 2 commits intomasterfrom
fix_localized_processing
Feb 11, 2026
Merged

Fix localized dataset processing#746
toebivankenoebi merged 2 commits intomasterfrom
fix_localized_processing

Conversation

@toebivankenoebi
Copy link
Copy Markdown
Contributor

Undo changes introduced by 3a7c49e: DontResolveLayers .
When deciding if a layer is localized we need to read Layers.

There's an issue with the latest qfieldsync release regarding localized datasets:
It's not showing the option to upload shared_datasets in the dialog and therefor it's not creating the shared_datasets project nor uploading any files. I could narrow it down to the get_localized_dataset_files function:

        for layer in layers.values():
            if not layer.dataProvider():
                continue

The problem is with the code change in 3a7c49e we don't resolve the layers and they then don't have a dataProvider so we always go out of the loop.

When disabling:

        if Qgis.versionInt() >= 32600:  # noqa: PLR2004
            # read_flags |= Qgis.ProjectReadFlag.DontResolveLayers
            read_flags |= Qgis.ProjectReadFlag.TrustLayerMetadata
            read_flags |= Qgis.ProjectReadFlag.DontLoad3DViews
        else:
            # read_flags |= QgsProject.ReadFlag.FlagDontResolveLayers
            read_flags |= QgsProject.ReadFlag.FlagTrustLayerMetadata

everything seems to work again:

  • Shared datasets are identified
  • Option for uploading missing shared datasets is shown (visibility is set to True)
  • When checkbox ticked, the project gets created/uploaded, a shared_datasets project is created and the shared dataset uploaded as well.

I'm unsure if we need the layers for

def _get_offline_layers(self) -> List[str]:

I leave that up to @nirvn to decide.

Undo changes introduced by 3a7c49e: `DontResolveLayers`
When deciding if a layer is localized we need to read Layers.
Copy link
Copy Markdown
Member

@nirvn nirvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

! good catch !

@nirvn nirvn force-pushed the fix_localized_processing branch from b31d0e9 to 9603663 Compare February 11, 2026 09:58
@toebivankenoebi toebivankenoebi merged commit 75140c0 into master Feb 11, 2026
8 checks passed
@toebivankenoebi toebivankenoebi deleted the fix_localized_processing branch February 11, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants