Bug report #18214

Layer lists in processing dialogs (e.g. r.patch, raster calculator) are not updated correctly when layers are added or removed or renamed

Added by Alister Hood about 6 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:3.4.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26105

Description

The list of input layers in the processing raster calculator dialog is not updated when a layer is removed (or added, although this is less annoying as it doesn't cause an error).
i.e.:
- run it once and don't close the dialog
- in the main QGIS window remove the layer that was created
- go back to the dialog and try to run it again, but you will get an error: "Unable to execute algorithm. Incorrect parameter value for LAYERS"

History

#1 Updated by Alister Hood about 6 years ago

  • Affected QGIS version changed from 3.0.0 to 3.1(master)

Sorry, the testing was on the latest osgeo4w64 nightly

#2 Updated by Alister Hood over 5 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

This has been fixed at some point.
But note that I may have been confused about this error: "Unable to execute algorithm. Incorrect parameter value for LAYERS"
It is currently produced if you try to run the raster calculator a second time without closing and reopening, or selecting a different reference layer.

#3 Updated by Alister Hood over 5 years ago

  • Resolution deleted (fixed/implemented)
  • Status changed from Closed to Reopened

Sorry, I was mistaken, it is not fixed, or at least not fully.
When you run it, if you didn't specify an output file, the OUTPUT layer that is created as a temporary file is not added to the list.

#4 Updated by Alister Hood over 5 years ago

Sorry, I was mistaken, it is not fixed, or at least not fully.
When you run it, if you didn't specify an output file, the OUTPUT layer that is created as a temporary file is not added to the list.

Also, after running the raster calculator, if you had a "Reference layer" selected, it will now be listed twice in the "Reference layer" dialog. If you select the other instance of your reference layer in the list, it will run without error. Presumably this is all related.

There is also an issue with updating the "Reference layer" dialog when a layer is removed - it still shows up in the "Reference layer" dialog until another layer change is made i.e. until another layer is added or removed.

#5 Updated by Alister Hood over 5 years ago

  • Affected QGIS version changed from 3.1(master) to 3.4.1

#6 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Reopened to Open

#7 Updated by Alister Hood over 5 years ago

Alister Hood wrote:

There is also an issue with updating the "Reference layer" dialog when a layer is removed - it still shows up in the "Reference layer" dialog until another layer change is made i.e. until another layer is added or removed.

i.e. updating the list for layer removals lags by one. But at least in 3.4.3 it affects the list in the main dialog, not just the reference layer list.

And there is also an issue when layers are renamed. If a layer (or more than one layer) is renamed (one or more times) then that isn't reflected in either the main dialog or the reference layer list, unless you subsequently add or remove a layer.

I guess I'll need to check these things in a nightly build as there has been some fixes to the raster calculator, and I'm not sure if they were before or after 3.4.3. But as of 3.4.3 it appears there are still more widespread issues with the layer lists in dialogs not updating correctly. e.g.:
- open the r.patch dialog from processing toolbox.
- look at the list of layers available to choose from in the dialog. Close the list, but not the main dialog.
- rename a layer in the layers panel.
- remove another layer in the layers panel.
- look again at the list of layers available to choose from in that dialog. You will see neither renaming nor removing a layer triggered the list to be updated. Close the list, but not the main dialog.
- drag and drop a new layer into the main qgis window.
- look again at the list of layers available to choose from in that dialog. You will see that the new layer is now included, and because that triggered the list to be updated, the previous layer renaming and removal is also reflected in the list.

N.B. I thought I described all these issues previously, but I can't find it anywhere else, so maybe I only started describing them, in this ticket...

#8 Updated by Alister Hood over 5 years ago

  • Subject changed from Processing raster calculator - dialog is not updated when layers are added or removed to Layer lists in processing dialogs (e.g. r.patch, raster calculator) are not updated correctly when layers are added or removed or renamed

Also available in: Atom PDF