Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] use active layer in the widget wrapper only for
non-optional parameters otherwise use default value

(cherry picked from commit f37a759)
  • Loading branch information
alexbruy authored and nyalldawson committed Dec 11, 2019
1 parent b2370bd commit 142ca73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/gui/wrappers.py
Expand Up @@ -936,7 +936,10 @@ def createWidget(self):
self.context = dataobjects.createContext()

try:
self.combo.setLayer(iface.activeLayer())
if self.parameterDefinition().flags() & QgsProcessingParameterDefinition.FlagOptional:
self.combo.setLayer(self.parameterDefinition().defaultValue())
else:
self.combo.setLayer(iface.activeLayer())
except:
pass

Expand Down

0 comments on commit 142ca73

Please sign in to comment.