Bug report #16770

copy/paste/save features from one layer to another of the same time broke in 2.18

Added by Gerhard Spieles over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Digitising
Affected QGIS version:2.18.10 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:24669

Description

Copy an oject from one Layer and insert this object inot another layer works. Saving this changes in the layer fails and qgis reports "Commit errors: Could not commit changes to layer 2_18_10_copyobjectto", open the complete error message result is:

"Could not commit changes to layer 2_18_10_copyobjectto

Errors: ERROR: 1 feature(s) not added - geometry type is not compatible with the current layer."

Both shape layer are polygons, created with QGIS2.18.10
Testproject with layers are attached, also screenshots.

testshpaddpolygonfail.zip (7.09 KB) Gerhard Spieles, 2017-06-30 10:07 AM

2_18_10_shp_copy_object_insert_ok.jpg (97.6 KB) Gerhard Spieles, 2017-06-30 10:07 AM

2_18_10_shp_copy_object_save_fails.jpg (89.9 KB) Gerhard Spieles, 2017-06-30 10:07 AM


Related issues

Related to QGIS Application - Bug report #16758: regression: adding a multi-part feature to a shapefile da... Closed 2017-06-27
Related to QGIS Application - Bug report #16948: "Paste features as..." always creates vector layer/scratc... Closed 2017-08-01

Associated revisions

Revision d19ed1c6
Added by Jürgen Fischer over 6 years ago

Only convert geometries to provider type when provider does strict type checking (ie. not for shapes; fixes #16593, #16784, #16792, #16770, followup 53d90b547)

Revision ecae3c95
Added by Jürgen Fischer over 6 years ago

Only convert geometries to provider type when provider does strict type checking
(ie. not for shapes; fixes #16593, #16784, #16792, #16770;
followup 87116abd72; forward ported from d19ed1c6)

History

#1 Updated by Gerhard Spieles over 6 years ago

  • Affected QGIS version changed from master to 2.18.10

#2 Updated by Giovanni Manghi over 6 years ago

  • Subject changed from shape, copy objects from one layer and insert into another layer fails, QGIS 2.18.10 reports ERROR: 1 feature(s) not added - geometry type is not compatible with the current layer. to copy/paste/save features from one layer to another of the same time broke in 2.18
  • Operating System deleted (win 7)
  • Regression? changed from No to Yes

Regression, worked as expected in 2.14

#3 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Data Provider/OGR to Digitising

#4 Updated by Giovanni Manghi over 6 years ago

Despite the error it seems the edits/pasted features are saved anyway.

In the log it shows this message that does not smell very well

2017-07-03T00:40:15 1 Unbalanced call to leaveUpdateMode() w.r.t. enterUpdateMode()

#5 Updated by Gerhard Spieles over 6 years ago

copy and paste works fine also in QGIS 2.18.9.

#6 Updated by Hynek Suchy over 6 years ago

I can confirm the issue.

I have installed QGIS 2.18.10 on Windows 10 machine.
Objects which I was copying were lines in ESRI shapefiles, (actually I have imported dxf file into QGIS and then trying to copy lines into existing shapefile).
Copying objects from one layer to the other was completed succesfully but on saving layer, there was error message something like: feature(s) not added - geometry type is not compatible with the current layer and I wasn't able to save changes to layer.

After that I switched back to 2.18.9. and there everything works fine.

#7 Updated by Jürgen Fischer over 6 years ago

  • Related to Bug report #16758: regression: adding a multi-part feature to a shapefile dataset fails added

#8 Updated by Jürgen Fischer over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

#9 Updated by Pedro Neves over 6 years ago

It seems to be present in QGIS 2.18.11. All the same symptoms as described by Hynek Suchy. I'm on Arch Linux...

#10 Updated by Giovanni Manghi over 6 years ago

Pedro Neves wrote:

It seems to be present in QGIS 2.18.11. All the same symptoms as described by Hynek Suchy. I'm on Arch Linux...

please post your datasets (or samples of them), thanks

#11 Updated by Pedro Neves over 6 years ago

I would, but the dxf's are too big. I'll see if I can reduce the features on them..

#12 Updated by Pedro Neves over 6 years ago

Giovanni: I've found a smaller file. How can I send it to you?

#13 Updated by Giovanni Manghi over 6 years ago

Pedro Neves wrote:

Giovanni: I've found a smaller file. How can I send it to you?

giovanni dot manghi at gmail dot com

#14 Updated by Pedro Neves over 6 years ago

File sent.

Thanks for your help.
Pedro

#15 Updated by Gerhard Spieles over 6 years ago

I test it with 2.18.11 under win10 and win7.
Copy and paste between shape/shape and shape/spatialite is ok.
I haven`t test it with dxf/geopackage.

#16 Updated by Giovanni Manghi over 6 years ago

see #16948

#17 Updated by Jürgen Fischer over 6 years ago

  • Related to Bug report #16948: "Paste features as..." always creates vector layer/scratch layer that can only handle just singlepart features, so pasting multipart features always returns an error added

Also available in: Atom PDF