Skip to content

Raise warning when trying to modify read-only layer with field calculator #63111

Description

@SGroe

What is the bug or the crash?

Currently QGIS silently does nothing when a field (or the geometry) of a read-only layer is modified with the field calculator. I suggest to show a warning or disable creating/updating fields. Creating virtual fields is still allowed.

Steps to reproduce the issue

  1. Set vector layer as read-only
  2. Open field calculator
  3. Select field to update
  4. Create an expression
  5. OK
  6. Dialog is closed, but nothing else happens. No data modification, which is good because layer is set to read-only. No warning, which is bad.

Versions

QGIS-Version3.40.10-Bratislava
QGIS-Codeversionc98da2e682
 
Bibliotheken
Qt-Version5.15.13
Python-Version3.12.11
GDAL-Version3.11.3 — Eganville
PROJ-Version9.6.2 (kompiliert)
9.5.0 (laufend)
EPSG-Registraturdatenbankversionv11.016 (2024-08-31)
GEOS-Version3.13.1-CAPI-1.19.2
SQLite-Version3.50.4
PDAL-Version2.9.0
PostgreSQL-Client-Versionunknown
SpatiaLite-Version5.1.0
QWT-Version6.3.0
QScintilla2-Version2.14.1
BS-VersionWindows 11 Version 2009
 
Aktive Python-Erweiterungen
Mergin2025.3.3
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Metadata

Metadata

Assignees

Labels

BugEither a bug report, or a bug fix. Let's hope for the latter!Field CalculatorGUI/UXRelated to QGIS application GUI or User Experience

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions