Attach File not Working in 2.3.4 with Firefox and SSO activated
Added by Dirk Goj almost 11 years ago
Hi.
OK, it's a little bit tricky...
We're using redmine with Kerberos-SSO using Single authentification plugin (http://github.com/AdamLantos/redmine_http_auth) in production.
Authentication is working fine but when trying to upload a file anywhere (ticket, wiki, files...) we get only a small info error and nothing will be uploaded. Analyzing with firebug got this message:
POST http://redmine02.hmm.lan/uploads.js?attachment_id=1&filename=test.txt 401 Authorization Required 7ms jquery...6832755 (Zeile 2)
The statement jquery.... is following link: http://redmine02.hmm.lan/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js?1386832755
In the testing-enviroment I replaced the file javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js with an actual jquery (1.10.2) without ui upload is working, but other things like deleting files will not work anymore.
How can the bundled jquery be replaced ? Alread searched around but found nothing...
using following versions in prod:
Environment:
Redmine version 2.3.2.stable.12119
Ruby version 1.8.7-p352 (2011-06-30) [x86_64-linux]
Rails version 3.2.13
Environment production
Database adapter MySQL
Redmine plugins:
redmine_http_auth 0.3.0-dev-redmine-2.x
versions in test:
Environment:
Redmine version 2.3.4.stable
Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux]
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
redmine_backlogs v1.0.6
redmine_http_basic_authentication 0.0.1
redmine_loader 0.3b
redmine_remote_user_auth 0.1.0
single_auth 1.0
Thx for any advice.... :)
Dirk
P.S. Just forget to mention: Error only in Firefox! Chrome and IE is working fine...
Replies (1)
RE: Attach File not Working in 2.3.4 with Firefox and SSO activated - Added by einhander e over 10 years ago
I also have this issue. It's only ocurs in case SSO, but if you manualy type login and password it OK.
It's nothing do about new jquery because jquery-1.9.x and above bumps into some error in application.js.
I've made some tricks to disable this error and try to go on, but error on file upload presents.
So it's possible to update to new jquery with migration plugin, but it's not solve issue.
Next I looked at attachments.js and find out that if I comment some check on file upload function, I can uplaod files.
It's near line 120.
function addInputFiles...
function addInputFiles(inputEl) { var clearedFileInput = $(inputEl).clone().val(''); // if (inputEl.files) { <--------My comments // upload files using ajax <--------My comments // uploadAndAttachFiles(inputEl.files, inputEl); <--------My comments $(inputEl).remove(); //} else { <--------My comments // browser not supporting the file API, upload on form submission var attachmentId; var aFilename = inputEl.value.split(/\/|\\/); attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); if (attachmentId) { $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]', style: 'display:none;' }).appendTo('#attachments_' + attachmentId); } //} <--------My comments clearedFileInput.insertAfter('#attachments_fields'); }
Im not programmer and this is ugly hack, but it's works.
P.S. My English is bad, sorry.