Univention Bugzilla – Bug 40648
TypeError: Cannot read property 'setDetails' of null
Last modified: 2021-04-16 10:50:35 CEST
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)"
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.
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?
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.