Bug 30965 - "Save" button in UCS@school computerroom does not work after update to UCS 3.1-1
"Save" button in UCS@school computerroom does not work after update to UCS 3.1-1
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.1-1-errata
Assigned To: Dirk Wiesenthal
Alexander Kläser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-02 12:07 CEST by Sönke Schwardt-Krummrich
Modified: 2013-04-09 16:58 CEST (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:
Ticket number:
Bug group (optional): API change
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2013-04-02 12:07:37 CEST
The "Save" button in the UCS@school UMC module "Room Management" does not work after update to UCS 3.1-1. On click nothing happens.
Comment 1 Dirk Wiesenthal univentionstaff 2013-04-02 12:20:51 CEST
Regression caused by Bug#30109: MultiObjectSelect does not have a isValid method, so it is "invalid".

If one clicks on "Save", something does happen: The form is validated, regarded as invalid and saving the room is aborted.
Comment 2 Dirk Wiesenthal univentionstaff 2013-04-02 14:37:42 CEST
The following Widgets are FormWidgets, but we do not implement isValid:

for f in $(grep isValid: *.js -L); do grep _FormWidgetMixin $f -l; done
CheckBox.js
ComboBox.js
HiddenInput.js
Image.js
MultiObjectSelect.js
MultiSelect.js
MultiUploader.js
NumberSpinner.js
PasswordBox.js
TextArea.js
TextBox.js
UnixAccessRights.js
Uploader.js

Note that in some cases (e.g. TextBox), the Dojo base class does implement it.

We could write isValid for all of these Widgets (just returning true, probably), or we could test if isValid exists in a BaseClass and return true otherwise:

_FormWidgetMixin.isValid:
  [...]
+ var superIsValid = this.inherited(arguments, true);
+ if (superIsValid !== undefined) {
+        return superIsValid.apply(this, arguments);
+ } else {
+        console.warn(this.declaredClass, "does not implement isValid(); return true");
+        return true;
+ }
- return this.inherited(arguments);

Note that this is also an API change, since some Widgets currently return undefined, but I would say that this is much cleaner (maybe remove the warning) and also holds for future Widgets.

I have validated an UDM-Form (users/user) (note that this is not done in udm, I had to do it manually):

umc.widgets.HiddenInput does not implement isValid(); return true
umc.widgets.PasswordInputBox does not implement isValid(); return true
umc.modules.udm.MultiObjectSelect does not implement isValid(); return true
umc.widgets.MultiSelect does not implement isValid(); return true

Error message from PasswordInputBox is caused by an unneeded this.inherited() in its own isValid().
Comment 3 Dirk Wiesenthal univentionstaff 2013-04-03 13:27:15 CEST
Fixed in
  univention-management-console-frontend 2.0.244-2.617.201304031313
resp
  univention-management-console-frontend 2.0.245-1.616.201304031212

YAML and Changelog created
Comment 4 Alexander Kläser univentionstaff 2013-04-04 12:36:20 CEST
== QA ==
I added in the frontend package the test file tests/form_widgets.html which integrates all Form-Elements (except MixedInput, but this can be neglected).

By default, all elements validate to true → OK

PasswordInputBox does not validate to false for two differing entries → FAIL
Comment 5 Dirk Wiesenthal univentionstaff 2013-04-04 14:04:52 CEST
(In reply to comment #4)
> PasswordInputBox does not validate to false for two differing entries → FAIL

I should listen to myself!

(In reply to comment #2)
> Error message from PasswordInputBox is caused by an unneeded this.inherited()
> in its own isValid().

Fixed in:
  univention-management-console-frontend 2.0.247-1.618.201304041328
resp
  univention-management-console-frontend 2.0.244-3.619.201304041347
Comment 6 Alexander Kläser univentionstaff 2013-04-04 14:37:29 CEST
== QA ==

(In reply to comment #5)
> I should listen to myself!

True :) !

> Fixed in:
>   univention-management-console-frontend 2.0.247-1.618.201304041328
> resp
>   univention-management-console-frontend 2.0.244-3.619.201304041347

Erratum changes: OK
YAML file: OK
3.1-2 changes: OK
3.1-1 Changelog: OK
Comment 7 Janek Walkenhorst univentionstaff 2013-04-09 16:58:42 CEST
http://errata.univention.de/3.1-errata83.html