Univention Bugzilla – Bug 47141
_SelectMixin depends changes can invalidate value
Last modified: 2021-05-14 16:34:44 CEST
If you have a _selectMixin that depends on another widget you can have the situation that you select a value in the Mixin and after that change the widget the Mixin depends on. That invalidates the entry and results best case in the Mixin showing an invalid value to the user (visible via form validation). That is a bad user experience. Examples: In the ucs-school-umc-users module this problem was catched and handled locally with a nasty workaround, that doesn't read nice. Also the computerroom module still has that problem in the room select dialog. It would be nice if this inconsistency could be handled globally in the _SelectMixin itself. For example resetting to a 'non value' entry of some sorts or the first entry in the new data.
Created attachment 9565 [details] Patch for fixing 47141 The attached patch seems to fix the problem by just resetting the initial value when the values of the _SelectMixin are cleared. But there is a code snippet doing almost the same, which is commented out without any explanation. Does someone know the reason for that and if the proposed patch would break something?
lines 259 to 263 of _SelectMixin.js in univention-web: //if (this._isAutoValue) { // // reset the _initialValue in case we chose it automatically // this._initialValue = null; //} //this._isAutoValue = false;
I tested on my development machine with this change while working and could not find any place where this change would have been a problem. src: univention-web fix: 2.0.0-14A~4.3.0.201806220835
--- mirror/ftp/4.3/unmaintained/component/4.3-1-errata/source/univention-web_2.0.0-13A~4.3.0.201806131727.dsc +++ apt/ucs_4.3-0-errata4.3-1/source/univention-web_2.0.0-14A~4.3.0.201806220835.dsc @@ -1,6 +1,10 @@ -2.0.0-13A~4.3.0.201806131727 [Wed, 13 Jun 2018 17:27:18 +0200] Univention builddaemon <buildd@univention.de>: +2.0.0-14A~4.3.0.201806220835 [Fri, 22 Jun 2018 08:35:42 +0200] Univention builddaemon <buildd@univention.de>: * UCS auto build. No patches were applied to the original source package + +2.0.0-14 [Fri, 22 Jun 2018 08:19:35 +0200] Ole Schwiegert <schwiegert@univention.de>: + + * Bug #47141: Reset selection of _SelectMixin if values are updated 2.0.0-13 [Wed, 13 Jun 2018 17:23:41 +0200] Johannes Keiser <keiser@univention.de>: <http://10.200.17.11/4.3-1/#6740363565807607880>
The patch has side effects on the prefilled values for 'Services' and 'DNS Forward and Reverse Lookup Zone' in the Computers module.
This issue has been filed against UCS 4.3. UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.