Red Hat Bugzilla – Bug 785857
deleting template causes resources with detached templates to throw exception
Last modified: 2015-02-01 18:27:34 EST
+++ This bug was initially created as a clone of Bug #767263 +++
1) create a drift template
2) go to resource A's drift tab, create definition from that template, but detach it
3) delete the template
4) go back to the resource A's drift tab
The template is no longer in existance. But the definition was detached, so it does not get deleted. However, what should it show in the "template" column of the table? It should probably be empty. But it looks like its trying to get the name of an non-existent template
This actually is pretty bad because now I can't view the drift definitions anymore, not just for this definition, but I assume I can't see any defs, because it's the table that can't render - and the table lists all definitions.
--- Additional comment from email@example.com on 2011-12-13 12:01:06 EST ---
--- STACK TRACE FOLLOWS ---
(TypeError): Cannot read property 'org_rhq_core_domain_drift_DriftDefinitionTemplate_name' of null
at Unknown.org_rhq_core_domain_drift_DriftDefinitionTemplate_$getName__Lorg_rhq_core_domain_drift_DriftDefinitionTemplate_2Ljava_lang_String_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_convert__Lorg_rhq_core_domain_drift_DriftDefinitionComposite_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_$copyValues__Lorg_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_2Lorg_rhq_core_domain_drift_DriftDefinitionComposite_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_copyValues__Ljava_lang_Object_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_copyValues__Ljava_lang_Object_2ZLcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_$buildRecords__Lorg_rhq_enterprise_gui_coregui_client_util_RPCDataSource_2Ljava_util_Collection_2Z_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_$buildRecords__Lorg_rhq_enterprise_gui_coregui_client_util_RPCDataSource_2Ljava_util_Collection_2_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_buildRecords__Ljava_util_Collection_2_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_$dataRetrieved__Lorg_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_2Lorg_rhq_core_domain_util_PageList_2Lcom_smartgwt_client_data_DSResponse_2Lcom_smartgwt_client_data_DSRequest_2V(Unknown source:0)
at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource$9$1_onPermissionsLoaded__Ljava_util_Set_2V(Unknown source:0)
--- Additional comment from firstname.lastname@example.org on 2011-12-13 13:48:00 EST ---
git commit to master: 1c2b7c6
jay looked around and didn't find any other places where driftDef.getTemplate() is called that isn't protected from null checks so this appears to be the only place where this problem occurred.
--- Additional comment from email@example.com on 2011-12-13 14:58:22 EST ---
documenting that i am reproducing the original error (I don't have the fix yet).... retest tomorrow.
--- Additional comment from firstname.lastname@example.org on 2011-12-14 05:51:16 EST ---
Verified on master build#833 (Version: 4.3.0-SNAPSHOT Build Number: ee66d10)
Created a drift template and a detached definition from that template in drift tab of resource. Deleted the template, navigated back to the resource's drift tab.
Verified that there is no exception thrown and the "template" column of detached drift definition table of the resource displays 'None'.
git commit to release/jon3.0.x branch: ceb7b6e
Switching to using MODIFIED for fixes that are in the appropriate but are waiting to get into a build.
Moving this to ON_QA as there is now a binary available to test with:
Bulk closing of old issues in VERIFIED state.