Skip to content

Commit

Permalink
fix row number calculation when reporting errors in the Processing batch
Browse files Browse the repository at this point in the history
mode (fix #39326)
  • Loading branch information
alexbruy committed Nov 26, 2020
1 parent 5bd0058 commit 220cb56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -600,7 +600,7 @@ def save(self):

if not param.checkValueIsAcceptable(value, context):
msg = self.tr('Wrong or missing parameter value: {0} (row {1})').format(
param.description(), row + 1)
param.description(), row + 2)
self.parent.messageBar().pushMessage("", msg, level=Qgis.Warning, duration=5)
return
algParams[param.name()] = param.valueAsPythonString(value, context)
Expand All @@ -616,7 +616,7 @@ def save(self):
else:
self.parent.messageBar().pushMessage("",
self.tr('Wrong or missing output value: {0} (row {1})').format(
out.description(), row + 1),
out.description(), row + 2),
level=Qgis.Warning, duration=5)
return
toSave.append({self.PARAMETERS: algParams, self.OUTPUTS: algOutputs})
Expand Down Expand Up @@ -743,7 +743,7 @@ def parametersForRow(self, row, destinationProject=None, warnOnInvalid=True):
if warnOnInvalid and not param.checkValueIsAcceptable(wrapper.parameterValue()):
self.parent.messageBar().pushMessage("",
self.tr('Wrong or missing parameter value: {0} (row {1})').format(
param.description(), row + 1),
param.description(), row + 2),
level=Qgis.Warning, duration=5)
return {}, False

Expand All @@ -766,7 +766,7 @@ def parametersForRow(self, row, destinationProject=None, warnOnInvalid=True):
else:
parameters[out.name()] = text
else:
msg = self.tr('Wrong or missing output value: {0} (row {1})').format(out.description(), row + 1)
msg = self.tr('Wrong or missing output value: {0} (row {1})').format(out.description(), row + 2)
self.parent.messageBar().pushMessage("", msg, level=Qgis.Warning, duration=5)
return {}, False
return parameters, True

0 comments on commit 220cb56

Please sign in to comment.