Summary of the patch files I'm providing:
Added an "if" statement in each of the two files in patch and moved an ill-placed sql query.
Changed code:
ajax_checklist.js - replace line 22 to line 44 with this:
$("div.ajaxchecklist/div.form-item/>").each(
function () {
$(this).click(
function () {
var thislabel=$(this).parent();
var colorbefore=$(thislabel).css("color");
if ( $(this).attr("checked") == undefined ) {
$(thislabel).css("color","red");
$.get("/ajaxchecklist/save/"+nodeid+"/"+$(this).attr("id")+"/0",
function() {
$(thislabel).css("color",colorbefore);
});
} else if ( $(this).attr("checked") == true ) {
$(thislabel).css("color","red");
$.get("/ajaxchecklist/save/"+nodeid+"/"+$(this).attr("id")+"/1",
function() {
$(thislabel).css("color",colorbefore);
});
} else {
$(thislabel).css("color","red");
$.get("/ajaxchecklist/save/"+nodeid+"/"+$(this).attr("id")+"/0",
function() {
$(thislabel).css("color",colorbefore);
});
}
});
});
}
);
ajax_checklist.module - replace line 69 to line 81 with this
if ($uid != 0) {
$existing=db_result(db_query("select count(state) from ajax_checklist ".
"where nid=$nid and user=$uid and qid='$qid'"));
if ($existing == 0) {
db_query("insert into ajax_checklist (nid,user,qid,state) ".
"values ($nid,$uid,'$qid',$state)");
} else {
$current=db_result(db_query("select state from ajax_checklist ".
" where nid=$nid and user=$uid and qid='$qid'"));
if ($current != $state) {
db_query("update ajax_checklist ".
"set state=$state where nid=$nid and user=$uid and qid='$qid'");
}
}
}
Comments
Comment #1
(not verified) commentedComment #2
asciikewl commentedAll of this should be fixed in the new versions.