Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting a field to a value via field calculator freezes qgis when "Automatic Creation of Transaction Group" is enabled #39178

Closed
faridcher opened this issue Oct 5, 2020 · 11 comments · Fixed by #39257
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@faridcher
Copy link

faridcher commented Oct 5, 2020

How to Reproduce
Try to set the tsize field of labs layer to NULL via field calculator .

related:
https://issues.qgis.org/issues/11422
subdiv.zip

@faridcher faridcher added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 5, 2020
@faridcher faridcher changed the title set a field to NULL via field calculator freezes qgis setting a field to NULL via field calculator freezes qgis Oct 5, 2020
@gioman
Copy link
Contributor

gioman commented Oct 5, 2020

@faridcher cannot confirm on 3.10.10 on Ubuntu 20.04-

@faridcher
Copy link
Author

faridcher commented Oct 5, 2020

upgraded to 3.10.10 and the problem persists. Please try with attached gpkg file in the original post. Try to set the tsize field of labs layer to NULL.

thanks

@elpaso
Copy link
Contributor

elpaso commented Oct 6, 2020

No issues here on QGIS master/linux

@gioman
Copy link
Contributor

gioman commented Oct 6, 2020

upgraded to 3.10.10 and the problem persists. Please try with attached gpkg file in the original post. Try to set the tsize field of labs layer to NULL.

thanks

@faridcher try with a new QGIS profile.

@gioman gioman added the Feedback Waiting on the submitter for answers label Oct 6, 2020
@faridcher
Copy link
Author

A new profile did not help. However, the problem relates to the qgis project file and it occurs when "Automatic Creation of Transaction Group" is enabled in the "Project Properties > Data Sources". Un-checking that option solves it.

@elpaso elpaso self-assigned this Oct 6, 2020
@elpaso elpaso removed the Feedback Waiting on the submitter for answers label Oct 6, 2020
@elpaso
Copy link
Contributor

elpaso commented Oct 6, 2020

This is indeed a big bad voracious 🐛

@gioman gioman changed the title setting a field to NULL via field calculator freezes qgis setting a field to NULL via field calculator freezes qgis when "Automatic Creation of Transaction Group" is enabled Oct 6, 2020
@gioman
Copy link
Contributor

gioman commented Oct 6, 2020

This is indeed a big bad voracious bug

@elpaso
same origin as #39177 ?

@elpaso
Copy link
Contributor

elpaso commented Oct 6, 2020

Definitely related.

@elpaso
Copy link
Contributor

elpaso commented Oct 6, 2020

I now know the source of the bug but the fix isn't trivial.

@elpaso
Copy link
Contributor

elpaso commented Oct 8, 2020

See also: #39244

@elpaso
Copy link
Contributor

elpaso commented Oct 8, 2020

Reproducing test case:

    def testTransactionGroupIterator(self):
        """Test issue GH #39178: the bug is that this test hangs
        forever in an endless loop"""

        project = QgsProject()
        project.setAutoTransaction(True)
        tmpfile = os.path.join(
            self.basetestpath, 'tempGeoPackageTransactionGroupIterator.gpkg')
        ds = ogr.GetDriverByName('GPKG').CreateDataSource(tmpfile)
        lyr = ds.CreateLayer('test', geom_type=ogr.wkbPoint)
        lyr.CreateField(ogr.FieldDefn('str_field', ogr.OFTString))

        f = ogr.Feature(lyr.GetLayerDefn())
        f.SetGeometry(ogr.CreateGeometryFromWkt('POINT (1 1)'))
        f.SetField('str_field', 'one')
        lyr.CreateFeature(f)

        del lyr
        del ds

        vl = QgsVectorLayer(tmpfile + '|layername=test', 'test', 'ogr')
        project.addMapLayers([vl])

        self.assertTrue(vl.startEditing())

        for f in vl.getFeatures():
            self.assertTrue(vl.changeAttributeValue(1, 1, 'new value'))

        # Test that QGIS sees the new changes
        self.assertEqual(next(vl.getFeatures()).attribute(1), 'new value')

@faridcher faridcher changed the title setting a field to NULL via field calculator freezes qgis when "Automatic Creation of Transaction Group" is enabled setting a field to a value via field calculator freezes qgis when "Automatic Creation of Transaction Group" is enabled Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants