plone/archetypes.referencebrowserwidget — pull request #15 by arterrey (2014-03-12 04:34:16+00:00)
Title: Bugfix 13853 selected items not checked

In reference to this bug: https://dev.plone.org/ticket/13853

**from the bug:**
in debugging it... I think the error is in the comparison q(this).attr('checked') === true

where the attribute returns a string and is compared with true. see http://stackoverflow.com/questions/10231292/jquery-no-longer-accepting-attrchecked-true-logic

function check_referenced_items(fieldname) {
425	var refs_in_overlay = jq('input.insertreference'),
426	uid_selector = "input[name='" + fieldname + ":list']",
427	current = jq(uid_selector), // the widget in the form
428	current_uids = current.map(function () {
429	if (jq(this).attr('checked') === true) {
430	return jq(this).attr('value');
431	}
432	return null;
433	});