Bug 40648 - TypeError: Cannot read property 'setDetails' of null
TypeError: Cannot read property 'setDetails' of null
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.2-x
Assigned To: UMC maintainers
:
Depends on:
Blocks: 53115
  Show dependency treegraph
 
Reported: 2016-02-12 16:17 CET by Florian Best
Modified: 2021-04-16 10:50 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-02-12 16:17:03 CET
Just stumbled upon this exception when using the LDAP-Directory in UMC after creating a container. I don't know what side effect it has, maybe that templates don't work?

It seems to be a side effect of Bug #38190.

this._newObjectDialog.setDetails(this._detailPage, template, properties); fails with:

TypeError: Cannot read property 'setDetails' of null(…) "TypeError: Cannot read property 'setDetails' of null
    at null.<anonymous> (https://xen3/univention-management-console/js_$20161202113821$/umc/modules/udm.js:1676:27)
    at https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:819:130
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    at h (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:263)
    at resolve (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:768:352)
    at https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:1916:111
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    at h (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:263)
    at resolve (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:768:352)
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    ----------------------------------------
    rejected at a (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:767:243)
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:496)
    at h (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:263)
    at resolve (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:768:352)
    at https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:1916:111
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    at h (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:263)
    at resolve (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:768:352)
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    at h (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:263)
    ----------------------------------------
Error
    at then.b.then (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:769:143)
    at declare.createDetailPage (https://xen3/univention-management-console/js_$20161202113821$/umc/modules/udm.js:1668:28)
    at null.<anonymous> (https://xen3/univention-management-console/js_$20161202113821$/umc/modules/udm.js:1566:10)
    at null.<anonymous> (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:819:130)
    at b.(anonymous function).t [as onFirstPageFinished] (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:1490:483)
    at declare.buildCreateWizard (https://xen3/univention-management-console/js_$20161202113821$/umc/modules/udm/NewObjectDialog.js:198:9)
    at null.<anonymous> (https://xen3/univention-management-console/js_$20161202113821$/umc/modules/udm/NewObjectDialog.js:178:11)
    at https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:819:130
    at e (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:766:337)
    at then.b.then (https://xen3/univention-management-console/js_$20161202113821$/dojo/dojo.js:769:198)"
Comment 1 Jürn Brodersen univentionstaff 2016-04-20 15:50:22 CEST
I also got this error.
This happens if the object you want to create has no wizard and the cache is empty. For example creating a new policy has no wizard but creating a user has.

Note on how to clear the cache:
"""
cache = require('umc/modules/udm/cache');
cache.reset()
"""

Code snippet from udm.js:
"""
if (this._newObjectDialog) {
	var getFromDetailPage = {
		properties: this._detailPage.propertyQuery,
		template: this._detailPage.templateQuery
	};
	all(getFromDetailPage).then(lang.hitch(this, function(results) {
		var properties = results.properties;
		var template = results.template && results.template.result;
		if (template && template.length > 0) {
			template = template[0];
		} else {
			template = null;
		}
		this._newObjectDialog.setDetails(this._detailPage, template, properties);
	}));
} else {
	this.selectChild(this._detailPage);
}
"""

while the code waits for "all(getFromDetailPage)" the "this._newObjectDialog" object gets deleted because NewObjectDialog.js doesn't find a wizard.
If the cache isn't empty the "all(getFromDetailPage)" call gets resolved immediately and "this._newObjectDialog" still exists.
Comment 2 Florian Best univentionstaff 2016-04-21 08:59:57 CEST
Ok this sounds reasonable. But is it an error / does it has effects e.g. that there is no dialog to choose a template, etc? (i think there are only user templates so that because users have a wizard this might have no effect).

this._newObjectDialog gets deleted because it is in that case not necessary to have it because the detail page should be opened directly. But maybe this is wrong and we have to wait for that deferred "all(getFromDetailPage)" to decide if we can remove this._newObjectDialog?
Comment 3 Stefan Gohmann univentionstaff 2019-01-03 07:23:17 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.