Bug 26780 - MultiObjectSelect-Widget formatter und staticValues im Form-Widget
MultiObjectSelect-Widget formatter und staticValues im Form-Widget
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.1
Assigned To: Florian Best
Dirk Wiesenthal
: interim-2
: 26781 (view as bug list)
Depends on:
Blocks: 26781
  Show dependency treegraph
 
Reported: 2012-04-13 11:16 CEST by Florian Best
Modified: 2012-12-12 21:08 CET (History)
2 users (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:
best: Patch_Available+


Attachments
umc-frontend.patch (2.15 KB, patch)
2012-04-13 11:16 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2012-04-13 11:16:09 CEST
Created attachment 4320 [details]
umc-frontend.patch

Das MultiObjectSelect-Widget sollte im formatter String-ID's in ein
{label,id}-dict umwandeln.

Wenn in einem Form-Widget staticValues anstatt dynamicValues benutzt werden,
wird eine Exception geworfen, weil statische Werte sofort initialisiert sind
und zu dem Zeitpunkt der Initialisierung die "Klassenvariable" für das Form
noch nicht existiert.

Im Anhang ist ein Patch, der beide Probleme behebt.
Comment 1 Alexander Kläser univentionstaff 2012-06-01 15:07:20 CEST
Den Patch sollten wir im Rahmen der UCS-Entwicklung einspielen :) .
Comment 2 Alexander Kläser univentionstaff 2012-06-01 15:07:38 CEST
*** Bug 26781 has been marked as a duplicate of this bug. ***
Comment 3 Florian Best univentionstaff 2012-07-19 18:30:34 CEST
eingespielt in univention-management-console-frontend (2.0.0-1)
Paket muss noch bauen
Comment 4 Alexander Kläser univentionstaff 2012-07-20 11:49:05 CEST
Ein else-Zweig wäre hier noch notwendig so weit ich das sehe:
====================
  if (dojo.isString(id)) {
    ids[i] = {label: id, id: id};
  }
  // else {
  //   ids[i] = id;
  // }
====================
Comment 5 Florian Best univentionstaff 2012-07-23 08:09:55 CEST
(In reply to comment #4)
> Ein else-Zweig wäre hier noch notwendig so weit ich das sehe:
> ====================
>   if (dojo.isString(id)) {
>     ids[i] = {label: id, id: id};
>   }
>   // else {
>   //   ids[i] = id;
>   // }
> ====================

Nein, ids[i] ist ja schon id.
Comment 6 Alexander Kläser univentionstaff 2012-07-23 11:36:42 CEST
(In reply to comment #5)
> Nein, ids[i] ist ja schon id.

Ah ja, das stimmt.
Comment 7 Alexander Kläser univentionstaff 2012-09-14 13:38:07 CEST
> formatter: function(ids) {
>     array.forEach(ids, function(id, i) {
>         if (typeof id == "string") {
>             ids[i] = {label: id, id: id};
>         }
>     });
>     return ids;
> },

Besser wäre es hier array.map() verwenden und so den initialen array mit IDs nicht zu verändern (das kann sonst zu Seiteneffekten führen).
Comment 8 Florian Best univentionstaff 2012-09-14 14:09:09 CEST
(In reply to comment #7)
> Besser wäre es hier array.map() verwenden und so den initialen array mit IDs
> nicht zu verändern (das kann sonst zu Seiteneffekten führen).
Ja, geändert in univention-management-console-frontend 2.0.57-1
Comment 9 Dirk Wiesenthal univentionstaff 2012-10-12 20:12:25 CEST
onValuesInitialized wurde von buildRendering nach startup verlagert. Neuer Formatter funktioniert.

Changelog OK.
Comment 10 Stefan Gohmann univentionstaff 2012-12-12 21:08:06 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

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