Bug report #12676
Subforms with Python init function crash when adding values
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | - | ||
Category: | Forms | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 20783 |
Description
Hello,
I am not anymore able to use subforms (based on project relations) which have a Python init function.
When trying to add values (or even cancelling new values), I've got a Python error dialog box:
An error occured during execution of following code: del _qgis_layer_ILL_PAE20150202141820409 Traceback (most recent call last): File "", line 1, in NameError: name '_qgis_layer_ILL_PAE20150202141820409' is not defined
It seems that QGIS is trying to call an already deleted (or not already created) Python variable.
When I add new objects on the subform, I've got another error text:
An error occured during execution of following code: DBPAT_FULL.testSub( _qgis_featureform_27, _qgis_layer_ILL_PAE20150202141820409, _qgis_feature_20150430144850051) Traceback (most recent call last): File "", line 1, in NameError: name '_qgis_layer_ILL_PAE20150202141820409' is not defined
This time it is launching my Python init fuction (named testSub) with an invalid reference to the layer...
It is not a blocker because you are able to add new lins to subforms. But the error dialog is always triggered when you close the parent form which is very annoying for end users.
The problem doesn't seem to come from the Python init function code because I've got the error dialog even with the following trivial function:
def testSub(dialog, layerid, featureid): QgsMessageLog.logMessage(u"testSub !", "DBPAT", QgsMessageLog.INFO)
When there is no Python init function, there is no error !
For me it is very annoying as it was not present in 2.6.1. QGIS 2.8.1 and master (well, nightly-build) are affected...
Thanks for (trying) to fix this bug...
Related issues
Associated revisions
History
#1 Updated by Giovanni Manghi over 9 years ago
- Target version changed from Future Release - High Priority to Version 2.8.2
- Priority changed from High to Severe/Regression
#2 Updated by Matthias Kuhn over 9 years ago
- Status changed from Open to Closed
Fixed in changeset 03da1fcabd31d6b726dffe8f8bb07c53d3f15132.