Univention Bugzilla – Bug 31855
Preventing certain UMC modules from being opened multiple times
Last modified: 2014-02-12 10:27:42 CET
Maybe we should add a generic mechanism to prevent multiple tabs of the same module. This lead to problems in the App Center and UCS@school Schoolrooms. Both required an ugly hack (which could be included in the app.js#openModule function). It could be stated in the XML file of that UMC module (<module unique="1">) or in the JS code ({unique: true}). I suggest the latter one because moving it in the "backend" module definition raises expectations that cannot be satisfied: The module can be initialised multiple times (once per session) but for the backend each frontend-tab of a module refers to the very same module, so stating unique=1 in the backend (I consider the XML file part of the backend although part of it is also passed to the frontend) is confusing. +++ This bug was initially created as a clone of Bug #31662 +++ UCS 3.1-1 Errata 119 While installing Zarafa in one App Center, I started another App center module instance in the same browser/UMC which resultet in the following traceback: Die Ausführung des Kommandos appcenter/packages/sections ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 282, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 384, in _response for res in function(self, iterator, *nones): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 266, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/__init__.py", line 293, in packages_sections for package in self.package_manager.packages(): File "/usr/lib/pymodules/python2.6/univention/lib/package_manager.py", line 478, in packages for pkg in self.cache: File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 173, in __iter__ yield self[pkgname] File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 161, in __getitem__ raise KeyError('The cache has no package named %r' % key) KeyError: "The cache has no package named 'libxss1'"
*** Bug 31877 has been marked as a duplicate of this bug. ***
Singleton... I was previously searching for this bug using "singleton". The next time I should be able to find :) .
(In reply to Alexander Kläser from comment #2) > Singleton... I was previously searching for this bug using "singleton". The > next time I should be able to find :) . Therefore you can use the 'Alias' field.
(In reply to Florian Best from comment #3) > (In reply to Alexander Kläser from comment #2) > > Singleton... I was previously searching for this bug using "singleton". The > > next time I should be able to find :) . > Therefore you can use the 'Alias' field. Hm, not exactly… alias works similar to an ID, it is unique, not like tags, for instance.
Needed for the App Center: openModule needs to return the tab it creates in openModule() (first part of the patch). But the "unique" workaround in the App Center would benefit from that (it somewhat prevents execution of openModule() if App Center is already opened), so openModule needs to natively support "unique: true" of a module (second part).
Created attachment 5766 [details] Support "unique" in a module; return the module of openModule()
(In reply to Dirk Wiesenthal from comment #5) > But the "unique" workaround in the App Center would benefit from that But the "unique" workaround in the App Center would *not* benefit from that
Fixed in univention-management-console-frontend 3.0.152-20.817.201402031320 Can be enabled with return declare("umc.modules.mymodule", Module, { + unique: true, [...] }); And openModule returns the module it has opened (or the unique one...): require('umc/app').openModule('appcenter').selectComponentsPage()
Please consider also that modules can have UMC-flavors.
(In reply to Florian Best from comment #9) > Please consider also that modules can have UMC-flavors. Considered in univention-management-console-frontend 3.0.152-21.819.201402041443
OK
http://errata.univention.de/ucs/3.2/61.html