Bug report #12711

Error when opening more than one form with init function

Added by Médéric RIBREUX over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Forms
Affected QGIS version:2.8.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 #:20817

Description

Hello,

when I open more than one form dialog on a layer with a Python init function, I have the following error message dialog box when I close the last form:

An error occured during execution of following code:
del _qgis_layer_parcelles20150504152756775

Traceback (most recent call last):
  File "", line 1, in 
NameError: name '_qgis_layer_parcelles20150504152756775' is not defined

Steps to reproduce it:
  • create a trivial Python init function (I use:
    def initFunc(dialog, layerid, featureid):
        pass
    
  • Set this Python init function in any Fields tab of layer properties.
  • Use the identify tool to open a form on a feature but do not close the form.
  • Use the identify tool to open another form on an another feature.
  • Close one of the two form dialogs (nothing happens).
  • Close the last form: error occurs !

I think this is related to #12676.

On QGIS 2.6.1, there is no error message.

Cheers !


Related issues

Related to QGIS Application - Bug report #12676: Subforms with Python init function crash when adding values Closed 2015-04-30
Related to QGIS Application - Bug report #13080: QT Forms. Opening two forms using IdentifyFeatures crashes Rejected 2015-07-06
Duplicated by QGIS Application - Bug report #12729: QT Forms. Opening two forms using IdentifyFeatures crashes Closed 2015-05-11

Associated revisions

Revision 03da1fca
Added by Matthias Kuhn over 9 years ago

Generate unique variable names for python init form

Fix #12676
Fix #12711
Fix #12729

Revision 9d7a650c
Added by Matthias Kuhn over 9 years ago

Generate unique variable names for python init form

Fix #12676
Fix #12711
Fix #12729

History

#1 Updated by Matthias Kuhn over 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF