Bug report #15640

Refactor fields: an expression is always required (otherwise python error is thrown)

Added by Paolo Cavallini about 8 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/Core
Affected QGIS version:3.0.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:23563

Description

When creating a new field through Processing > Refactor fields, an expression seems always required. I do not think this should be necessary, because users sometimes want just to add a new empty column to be filled afterwards.

Associated revisions

Revision 2900acef
Added by Nyall Dawson over 6 years ago

[processing] Fix crash when algorithms fail to prepare

Refs #15640

Revision cc10bbd9
Added by Nyall Dawson over 6 years ago

[processing] Allow empty expressions in refactor fields alg

Fixes #15640

Revision cdf0cd19
Added by Nyall Dawson over 6 years ago

[processing] Fix crash when algorithms fail to prepare

Refs #15640

(cherry-picked from 2900ace)

Revision 123c13d5
Added by Nyall Dawson over 6 years ago

[processing] Allow empty expressions in refactor fields alg

Fixes #15640

(cherry-picked from cc10bbd)

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Paolo Cavallini over 6 years ago

  • Assignee deleted (Victor Olaya)
  • Affected QGIS version changed from 2.16.3 to 3.0.0

Adding a string whatsoever is a workaround, but I still think the alg should accept an empty expression instead of throwing:

Traceback (most recent call last): File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/processing/algs/qgis/FieldsMapper.py", line 144, in prepareAlgorithm expression.parserErrorString())) _core.QgsProcessingException: Parser error in expression "": syntax error, unexpected $end

#3 Updated by Giovanni Manghi over 6 years ago

  • Subject changed from Refactor fields: an expression is always required to Refactor fields: an expression is always required (otherwise python error is thrown)
  • Category changed from Processing/GUI to Processing/Core

#4 Updated by Nyall Dawson over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

#5 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF