Skip to content
Permalink
Browse files

[processing] Fix exception on launching refactor fields

(The logic with parameter widget_wrapper metadata is very gross -
but there's nothing we can do about it till 4.0!)

Fixes #20707

(cherry picked from commit a947bbf)
  • Loading branch information
nyalldawson committed Dec 3, 2018
1 parent 0c36b90 commit 039a6c5a59e4c960c352e7eb1603db283df4592e
Showing with 5 additions and 2 deletions.
  1. +5 −2 python/plugins/processing/gui/wrappers.py
@@ -1772,8 +1772,11 @@ class WidgetWrapperFactory:

@staticmethod
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)
else:
# try from c++ registry first

0 comments on commit 039a6c5

Please sign in to comment.
You can’t perform that action at this time.