Bug report #19979

Data defined label does not works anymore in combinaison with rule based labeling

Added by Dominique Lyszczarz over 5 years ago. Updated almost 5 years ago.

Assignee:Nyall Dawson
Affected QGIS version:3.2.3 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27801


Please find in attachement a simple project that illustrate the issue : trying moving a label does not works.

The issue appears since 3.2.2 or 3.2.3 (as I tested it works correctly on 3.2.0 and fails on 3.2.3).

After more investigation, I could notice that a project with this kind of setup saved with 3.2.0 also works correctly on 3.2.3 but will fails again if the rules are editing. Comparing qgs files between a working and non working reveals that non working file missing rule uuid :

working qgs file:
<labeling type="rule-based">
<rules key="{106f3856-6dcc-4ea3-8be9-d41a6fa39b68}">

non working qgs file:
<labeling type="rule-based">
<rules key="">

Adding an uuid make the labels movable again.

Investigate the commits, it seems b6901e2 is the cause of the regression : uuid creation was removed from qgsrulebasedlabeling.cpp (line 68)

data_defined_rules_labels.qgz (4.82 KB) Dominique Lyszczarz, 2018-09-28 11:42 PM

Associated revisions

Revision 0e2ceb90
Added by Nyall Dawson over 5 years ago

Fix rule based labeling does not permit moving labels using interactive tool

Fixes #19979


#1 Updated by Nyall Dawson over 5 years ago

  • Assignee set to Nyall Dawson
  • Status changed from Open to In Progress

#2 Updated by Nyall Dawson over 5 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#3 Updated by Decio Yokota almost 5 years ago

Moving labels doesn't seem to work again in version 3.6.2. This is probably true in earlier versions as seen in: https://gis.stackexchange.com/questions/290780/move-label-not-working/321272#321272

Manually clicking in data defined X and Y coordinates and storing them on project makes it work.

Also available in: Atom PDF