Bug 32902 - MultiInput does not set value correctly
MultiInput does not set value correctly
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UNSTABLE
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Dirk Wiesenthal
Alexander Kläser
: interim-3
Depends on:
Blocks: 23214 32942 32963
  Show dependency treegraph
 
Reported: 2013-10-19 02:24 CEST by Dirk Wiesenthal
Modified: 2013-11-19 06:44 CET (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 Dirk Wiesenthal univentionstaff 2013-10-19 02:24:45 CEST
Since Bug#31376: Problem is _setAllValues(), which sets values not before this._allWidgetsBuiltDeferred.

But _setValueAttr does:
_setAllValues(vals);
_set('value', this.get('value')); // currently empty!
Comment 1 Dirk Wiesenthal univentionstaff 2013-10-19 03:07:55 CEST
I moved this._set('value') from _setValueAttr to _setAllValueAttr. Should work although it feels wrong to not immediately set a value.
  univention-management-console-frontend 3.0.113-1.759.201310190251
Comment 2 Dirk Wiesenthal univentionstaff 2013-10-31 21:39:52 CET
Maybe just

_registerOptionWatchHandler: function() {
  var optionsWidget = this._form.widgets.$options$;
+ if (!optionsWidget) {
+   return;
+ }
  this.own(optionsWidget.watch('value', lang.hitch(this, function(attr, oldVal, newVal) {
    this.onOptionsChanged(newVal);
  })));
  ...


At least it worked for me. But I do not want to mess around. Please also see Bug#32381, Comment 17 - maybe caching problem? Or maybe just timing... I don't know.
Comment 3 Dirk Wiesenthal univentionstaff 2013-10-31 21:40:20 CET
(In reply to Dirk Wiesenthal from comment #2)
> Maybe just
> 
> _registerOptionWatchHandler: function() {
>   var optionsWidget = this._form.widgets.$options$;
> + if (!optionsWidget) {
> +   return;
> + }
>   this.own(optionsWidget.watch('value', lang.hitch(this, function(attr,
> oldVal, newVal) {
>     this.onOptionsChanged(newVal);
>   })));
>   ...
> 
> 
> At least it worked for me. But I do not want to mess around. Please also see
> Bug#32381, Comment 17 - maybe caching problem? Or maybe just timing... I
> don't know.

Oops. Wrong bug!
Comment 4 Dirk Wiesenthal univentionstaff 2013-11-01 09:53:33 CET
Changelog not needed, bug during development
Comment 5 Alexander Kläser univentionstaff 2013-11-01 10:17:12 CET
The changes look good. In my test, the watch handler was called properly after all values have been loaded.
Comment 6 Stefan Gohmann univentionstaff 2013-11-19 06:44:35 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".