Ticket #7936 (closed Bug: fixed)

Opened 4 years ago

Last modified 3 years ago

Inserted references not checked by default on Internet Explorer 7

Reported by: ivo Owned by: dannyb
Priority: critical Milestone: 3.1
Component: Archetypes Keywords:
Cc:

Description

On Internet Explorer 7 (and perhaps 6), references that are inserted through ATRBW are not checked by default (like they are with, for example, Firefox). If the editor doesn't notice this, the reference will eventually not be added which is totally contrary to what a user would expect.

The fix is to make sure the "checked" attribute is set *after* adding the new element to the dom. I.e. in skins/ATReferenceBrowserWidget/referencebrowser.js, the function referencebrowser_setReference() should look as follows (the last actual line of code is the relevant fix)

// function to return a reference from the popup window back into the widget
function referencebrowser_setReference(widget_id, uid, label, multi)
{
    // differentiate between the single and mulitselect widget
    // since the single widget has an extra label field.
    if (multi==0) {
        element=document.getElementById(widget_id)
        label_element=document.getElementById(widget_id + '_label')
        element.value=uid
        label_element.value=label
     }  else {
         // check if the item isn't already in the list
         var current_values = cssQuery('#' + widget_id + ' input');
         for (var i=0; i < current_values.length; i++) {
            if (current_values[i].value == uid) {
              return false;
            }
          }         
          // now add the new item
          list=document.getElementById(widget_id);
          li = document.createElement('li');
          label_element = document.createElement('label');
          input = document.createElement('input');
          input.type = 'checkbox';
          input.value = uid;
          input.checked = true;
          input.name = widget_id + ':list';
          label_element.appendChild(input);
          label_element.appendChild(document.createTextNode(label));
          li.appendChild(label_element);
          list.appendChild(li);
          // fix on IE7 - check *after* adding to DOM -- ivo@m3r.nl 2008/03/11
          input.checked = true;
     }
}

I consider this bug rather serious, it will add alot of confusion for IE7 users.

Change History

comment:1 Changed 4 years ago by wichert

You have commit access, please check this in yourself.

comment:2 Changed 4 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in 2.0.2.

comment:3 Changed 3 years ago by hannosch

  • Component changed from ATReferenceBrowserWidget to Archetypes
Note: See TracTickets for help on using tickets.