Skip to content


[processing] Fix exception on launching refactor fields
Browse files Browse the repository at this point in the history
(The logic with parameter widget_wrapper metadata is very gross -
but there's nothing we can do about it till 4.0!)

Fixes #20707
  • Loading branch information
nyalldawson committed Dec 4, 2018
1 parent 0ba37fc commit 9c1653f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/gui/
Expand Up @@ -1772,8 +1772,11 @@ class WidgetWrapperFactory:

def create_wrapper(param, dialog, row=0, col=0):

if param.metadata().get('widget_wrapper', {}).get('class', None) is not None:
wrapper_metadata = param.metadata().get('widget_wrapper', None)
# VERY messy logic here to avoid breaking 3.0 API which allowed metadata "widget_wrapper" value to be either
# a string name of a class OR a dict.
# TODO QGIS 4.0 -- require widget_wrapper to be a dict.
if wrapper_metadata and (not isinstance(wrapper_metadata, dict) or wrapper_metadata.get('class', None) is not None):
return WidgetWrapperFactory.create_wrapper_from_metadata(param, dialog, row, col)
# try from c++ registry first
Expand Down

0 comments on commit 9c1653f

Please sign in to comment.