Opened 7 years ago

Closed 7 years ago

#2096 closed defect (fixed)

Incorrect settings when editing a synchronization filter for an item list

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 3.11.2
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

When opening an existing synchronization filter that has either the "Parent item" or "Child item" option selected the "of type" option is not set correctly.

It seems like the first option in the list is always selected instead of the actual item type stored in the filter. As a consequence, the filter summary display "no filter" instead of the actual filter. Manually selecting the correct option for the "of type" setting brings the correct filter back.

NOTE! It seems like this problem appears in some browsers only (IE11, Edge, Chrome). It worked when I first tested it with Firefox, but it turned out I used an old version (52). After updating to Firefox 55 it stopped working in Firefox as well.

Change History (3)

comment:1 by Nicklas Nordborg, 7 years ago

Description: modified (diff)
Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 7 years ago

The problem seems to be related to the way the "of type" list is populated. It is done with javascript using new Option(title, value, selected), but the 3:rd parameter is the "default selected" parameter. To actually set the selected status of an option a fourth parameter is needed according to the specification:

... If the selected argument is present and true, the new object must
have its selectedness set to true; otherwise the fourth argument is 
absent or false, and the selectedness must be set to false, even if 
the defaultSelected argument is present and true....

So, it seems like the old behavior in Firefox is incorrect according to the specifications and now that it has been fixed it breaks stuff in BASE.

I think there may be a lot more places in BASE and in extensions that need to be updated.

comment:3 by Nicklas Nordborg, 7 years ago

Resolution: fixed
Status: assignedclosed

(In [7402]) Fixes #2096: Incorrect settings when editing a synchronization filter for an item list

It seems like this was the only place were new Option() was called with 3 parameters. In all other places 4 parameters are used and code is expected to work.

Note: See TracTickets for help on using tickets.