Download & Extend

Upload Javascript Errors

Project:OG User Roles
Version:6.x-4.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Hi,

I'm having a problem with group admins uploading files using both the core upload module and the filefield module. The progress bar starts then I get the following error message:

An AJAX request was aborted (status code 0). Path:/upload/js, readyState:undefined, statusText:'n/a', responseText:'XXX

Where "XXX" is the output of my 403 Access denied page.

A couple of things I've tried

- Same error in chrome/firefox/ie
- Works fine when user is given site-wide role
- Works with javascript disabled
- Have checked upload limits/file types/php upload settings etc.
- Have emptied cache etc.

I suspect what is happening is the AJAX uploader is calling /upload/js which hasn't been granted access via OGUR? Any ideas on how to fix it?

Comments

#1

Version:6.x-1.4» 6.x-1.5
Status:active» needs review

In case anyone has the same problem, here's how I fixed it (feel free to turn into a patch if anyone is able to do so)
Line #2607

// Fix Ajax Uploads
if (arg(0) == 'filefield' && arg(1) == 'ahah') {
$location = 164;
if (isset($_SESSION['og_last'])) $gid = $_SESSION['og_last'];
}

Hope this helps somebody!

#2

Version:6.x-1.5» 6.x-4.1

Problem still exists in 6.x-4.1
Any idea to fix this ?

Thanks

Laurent

#3

Status:needs review» active

#4

Status:active» needs review

I found and fixed the upload error too!

My client is going to test this too, but on our test environment this patch proved to work nicely!

@hbevan thanks for the inspiration! ;)

AttachmentSize
799100_filefield_ahah_upload.patch 835 bytes
nobody click here