diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-09-15 10:38:59 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-09-19 08:19:50 +0200 |
commit | b18e93d73dadacb1d36f0e0fa7a19bbb188e8d75 (patch) | |
tree | 3c110c085d8a8a8b2734a68d7c0a60ba3cb06728 /data/rhlib/fixingAttMIME.js | |
parent | 065050a6a64761ca9e76ea4bbd9b90343c1ccfa4 (diff) | |
download | bugzilla-triage-b18e93d73dadacb1d36f0e0fa7a19bbb188e8d75.tar.gz |
Fix calls of bugzilla.updateAttachMimeType to the new API.
Bugzilla guys are working on fix, but they provided workaround.
Fixes #124
Diffstat (limited to 'data/rhlib/fixingAttMIME.js')
-rw-r--r-- | data/rhlib/fixingAttMIME.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/data/rhlib/fixingAttMIME.js b/data/rhlib/fixingAttMIME.js index 220b7ad..56e10ba 100644 --- a/data/rhlib/fixingAttMIME.js +++ b/data/rhlib/fixingAttMIME.js @@ -44,24 +44,37 @@ function XMLRPCcallback() { * this change }; * */ -function fixAttachById(id, type, email) { +function fixAttachById(bugId, id, type, email) { + myDebug("bugId = " + bugId + ", id = " + id); if (type === undefined) { type = "text/plain"; } if (email === undefined) { - email = false; + email = 0; + } + + // Logic of nomail is negative ... turn around + email = !email; + + if (email === true) { + email = 1; + } + else { + email = 0; } // https://bugzilla.redhat.com/\ // docs/en/html/api/extensions/compat_xmlrpc/code/webservice.html // test on https://bugzilla.redhat.com/show_bug.cgi?id=485145 var params = { + 'id': bugId, 'attach_id' : id, 'mime_type' : type, - 'nomail' : !email + 'nomail' : email }; - makeJSONRPCCall("bugzilla.updateAttachMimeType", params, XMLRPCcallback); + // makeJSONRPCCall("bugzilla.updateAttachMimeType", params, XMLRPCcallback); + makeJSONRPCCall("RedHat.updateAttachMimeType", params, XMLRPCcallback); reqCounter++; } @@ -75,6 +88,7 @@ function fixAttachById(id, type, email) { function addTextLink(att) { var elemS = att.element.getElementsByTagName("td"); var elem = elemS[elemS.length - 1]; + myDebug("att = " + att.toSource()); createDeadLink("addFix2TextLink", "text", elem, fixAttachById, - [ att.id ], "br"); + [ att.bugId, att.id ], "br"); } |