plupload_element_value() has this code to find values based on $form_state['input'] keys:
$files = array();
foreach ($form_state['input'] as $key => $value) {
if (preg_match('/' . $id . '_([0-9]+)_(.*)/', $key, $reg)) {
$i = $reg[1];
$key = $reg[2];
$files[$i][$key] = $value;
}
$files[$i]['tmppath'] = variable_get('plupload_temporary_uri', 'temporary://') . $files[$i]['tmpname'];
}
However, when the preg_match does not match, $i will be undefined (or the previous value), and $files[$i] will throw a notice for $i being undefined much like $files[$i]['tmpname'] being undefined. Not sure why is this last line out of the if(). $files starts off as an empty array and we only ever set any $files[$i][$key] when we know $key is like $id_(number)_(something), which does not sound like it is ever going to be tmpname?!?
Immediate workaround to check for !empty($i) attached but still not sure about how this is supposed to work.
Comment | File | Size | Author |
---|---|---|---|
#44 | plupload-953242-44.patch | 4.42 KB | David_Rothstein |
#35 | Untitled-1.jpg | 99.04 KB | edg1 |
#29 | plupload.zip | 274.2 KB | elgandoz |
#23 | plupload-workaround-22.patch | 4.01 KB | DonZeptero |
#21 | plupload-workaround-21.patch | 3.34 KB | mathiasgmeiner |
Comments
Comment #1
eigentor CreditAttribution: eigentor commentedCan confirm this and in consequence cannot upload any files. Get a nice error message though:
Comment #2
eigentor CreditAttribution: eigentor commentedCan confirm Gabors patch makes the error message go away. Still no files get uploaded at my site, but this may be due to some misconfiguration. Since the installation profile media_dev does not work, I tried installing all the modules manually and get strange errors when trying to upload and insert files:
Comment #3
slashrsm CreditAttribution: slashrsm commentedI can confirm, that error messages diappear with this patch, but upload still do not work.
I believe that there is a problem with uploaded files, since it looks to me, that they are not passed to plupload_element_value(). I checked the $form_state['input'] and found out that $form_state['input']['edit-upload_count'] always gets value 0. I believe this should be the number of uploaded files, so always >0?
Comment #4
benanderson CreditAttribution: benanderson commentedsubscribe: I'm experience the same issue...
Comment #5
eigentor CreditAttribution: eigentor commentedStill same error message with latest dev of plupload. No files get uploaded.
Comment #6
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi, also having this issue. *subscribe*
Can confirm the part where "$form_state['input']['edit-upload_count'] always gets value 0" ;)
Comment #7
sea4 CreditAttribution: sea4 commented+1 having the same issues
Comment #8
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi,
I did some debugging. At nothing worked but when you look at this code...
...and if you uncomment the...
...part my files get uploaded but still don't reach the "plupload_element_value". No solution yet, but maybe this helps sb else ;).
Also I have installed this now on 3 different plattforms (using latest drupal dev) so I'm not sure this is a simple config error.
Greetings,
Sebastian
Comment #9
Sebastian.Buesing CreditAttribution: Sebastian.Buesing commentedHi again :),
well I did some further debugging. First mistake I already mentioned is that some how $_REQUEST['name'] doesn't end on .tmp. Not sure if this is a configuration error. I couldn't find anything alike. For the part of the files not getting processed I wrote some workaround which you are free to test, before I or anyone else (feel free to do it) puts them in a patch. Well here they are:
in plupload_handle_uploads:
replace:
with:
and
with
almost there...now replace in plupload_element_value
with
This should allow you to upload again, if you had the same problem as I did. However this is not a real solution to the problem but merely a workaround.
Greetings,
Sebastian
Comment #10
mathiasgmeiner CreditAttribution: mathiasgmeiner commentedHey thanks for this workaround!
I modified it a little bit to get it working, I repleaced every
variable_get('plupload_temporary_uri', 'temporary://')
withfile_directory_temp()
. I'm able to upload files, but sometimes it acts a little bit strange. So, not stable at all!In "plupload_element_value" from:
$files[$index]['tmppath'] = variable_get('plupload_temporary_uri', 'temporary://') . $file['tmpname'];
to
$files[$index]['tmppath'] = file_directory_temp() .'/'. $file['tmpname'];
In "plupload_handle_uploads" from:
$temp_directory = variable_get('plupload_temporary_uri', 'temporary://');
to
$temp_directory = file_directory_temp();
Comment #11
rudders CreditAttribution: rudders commented+1 for the error - subscribing
Comment #12
ricodol CreditAttribution: ricodol commentedDear all,
+1 for the error -subscribing
I try the workaround #9 and #10
but
it seems there is an error with $temp_directory ?
so If someone have some ideas I would be happy to test them..
Bruno
Comment #13
ricodol CreditAttribution: ricodol commentedthe line is in the workaround
proposed in #9 in function
plupload_handle_uploads() {
so if someone could post a working pluload.module (or near working) I will be pleased
thks
Bruno
Comment #14
gregglesLet's see if assigning this to effulgentsia helps get attention ;)
Comment #15
Rj-dupe-1 CreditAttribution: Rj-dupe-1 commentedsubscribe
Comment #16
effulgentsia CreditAttribution: effulgentsia commentedI'm not sure if this is right, but posting a quick stab. Will look more into it later, but if anyone wants to post results, that would help.
Comment #17
ricodol CreditAttribution: ricodol commentedThks for your post,
I apply the patch on 7.x-1.x-dev
now no more php error
BUT no upload
I selecte files, upload start, the plupload element disappear (i made screen shot) at the end of all upload files
I don t know if it s related to plupload or Media Gallery (7.x-1.0-beta3)
If you have ideas I m open to test,
thks again for your work,
Bruno
Comment #18
hasdf CreditAttribution: hasdf commentedTested with Plupload 7.x-1.x-dev and Media Gallery 7.x-1.0-beta3,
I have the same results as ricodol posted. But in my Case, the plupload element is just replaced with the standard upload for media.
Thanks for your work. I will try testing it on a fresh drupal install...
Martin
Comment #19
carwin CreditAttribution: carwin commentedsubscribe
Comment #20
Tiktaalik CreditAttribution: Tiktaalik commentedSubscribe.
Comment #21
mathiasgmeiner CreditAttribution: mathiasgmeiner commentedThis patch is the summary of all the workarounds and patches until #953242-16: Undefined $i wreaks havoc in plupload_element_value(). It works for me at two different Drupal-installations.
It has still bugs: e.g. upload in Google Chrome (9.0.597.84 beta) isn't working,...
Comment #22
sudotrin CreditAttribution: sudotrin commented#21 worked for me! Thank you!!
As an aside - I noticed earlier when I was trying to get this to work that there was an issue with getting the '.' between the name and extension in Chrome. I've been going through and trying to find the point when that happened to no avail. Also when using this in Opera, if there are spaces in the file name it errors - but still uploads the file.
Also this in the error console:
Comment #23
DonZeptero CreditAttribution: DonZeptero commentedi modified the workaround a little, now it workes for me without warning and error.
plupload version: 7.x-1.0-beta1
media version: 7.x-1.x-dev
media gallery version: 7.x-1.0-beta3
DonZeptero
Comment #24
Tiktaalik CreditAttribution: Tiktaalik commentedHi,
Using DonZeptero's -22 patch, I get the following:
after I attempt to drag-drop a single JPG image.
Comment #25
joelving CreditAttribution: joelving commentedHi,
Using #22's patch, I get the same errors as #24. The files will reside in the temp-folder with the temporary filenames.
If, however, I comment out the unlinking of the files (~line 290), the first file in the series will be moved to the files folder and renamed properly. At this point I get the same error, which suggests that while plupload returns the correct objects for further processing, the module actually responsible for the move neglects to update the path from the temp-folder to the files folder, which in my case of course prevents Media Gallery from creating the nodes.
I hope someone can use this, as I have nowhere near the experience nor knowledge required to actually figure out what is going on behind the scenes. :)
Btw, should the in-stream not be closed as well when we're done reading from it? (~line 280).
Comment #26
camdarley CreditAttribution: camdarley commentedsubscribe
Comment #27
ricodol CreditAttribution: ricodol commentedUsing #22's patch, I get the same errors as #24 and # 25
So hope someone with knowledge (and time..) would take care of the situation.
because
I don't know an alternative to upload a lot of image or media in media gallery ?
I don't know if media gallery could create nodes from local images (import by ftp) ?
so any advance in plupload integration would be benefit.
BRuno
Comment #28
elgandoz CreditAttribution: elgandoz commentedsub
Comment #29
elgandoz CreditAttribution: elgandoz commentedI used the plupload module from drupalgardens.com, and it simply works. no errors displayed, no patches needed.
Why is not possible put this version as "Satble" or as "Working beta" at least, instead of 2 not-working modules?
test the attached module (by Acquia), no extra download needed.
Works as expected with
Comment #30
ricodol CreditAttribution: ricodol commentedThanks for your post !!!!
This version works with me,
thks again
Bruno
Comment #31
Tiktaalik CreditAttribution: Tiktaalik commented#29's zip works for me too - no error messages on upload, multiple drag-and-drop uploads succeed.
I see it's an old Plupload though.
Comment #32
Carnivora CreditAttribution: Carnivora commented#29 works like a charm for my drupal7 , too
Comment #33
edg1 CreditAttribution: edg1 commented#29 still doesn't work for me.
I must have fucked around to much with the jquery update and plugin.
I was thinking in the direction that i needed a more recent version of jqueery to get it working..
also the plugin is using a JQUERY LOADER PLUGIN where do you have to store these things?
Are the solved by the libraries plugin.
do you need a seperate jquerry upgrade plugin.
Any thoughts??
Comment #34
edg1 CreditAttribution: edg1 commentedI've tried to install the pecl library uploadprogress but still no luck
I will keep on trying things.
Comment #35
edg1 CreditAttribution: edg1 commentedI've updated the php5-dev on my debian server to work with the pecl (i also needed to run a apt-get update before i got the right version)
after that i installed the uploadprogress because this wasn't good set and i had a report about is in my reports in drupal
http://perlucida.com/blog/software/howto-install-pecl-uploadprogress-ind...
I updated the jquery using jquery update module
I think after doing a cache refresh all this worked for me
Kind regards @elgandos this sure will safe me tons of time ;-)
I do have some questions and pointers.
Why are we using now a module for jquery upload , a module for library (wich doesn't work for me), a module for jquery plugins.
what i don't understand how can u use the jquery plugin in drupal ?
does any one have some comments here ???
Comment #36
Ryanbach CreditAttribution: Ryanbach commentedSub.
Comment #37
Ryanbach CreditAttribution: Ryanbach commentedWithout this you can not upload multiple files correctly, thus the priority should be set to critical.
Comment #38
Ryanbach CreditAttribution: Ryanbach commented#35 PECL is not needed, upload status is done though JavaScript.
Comment #39
jmsherry CreditAttribution: jmsherry commentedsubscribing
Comment #40
rikclout CreditAttribution: rikclout commentedsubscribing
Comment #41
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedsubscribing
Comment #42
elgandoz CreditAttribution: elgandoz commented#29 module does not works for you, guys?!
Comment #43
Thomas Bosviel CreditAttribution: Thomas Bosviel commented#29 works for me. It seems that major version 1.4.0 breaks compatibility.
Comment #44
David_Rothstein CreditAttribution: David_Rothstein commentedHere's a patch that should make the module work with newer versions of the plupload JavaScript library (I tested with 1.4.2, the current latest version).
It turns out there were two changes that affected us here:
I've done some light testing of this patch in different browsers and with the various runtimes (HTML4, HTML5, Flash) and it seems to work, but more testing as well as reviews would be highly welcome. We're hoping to put out a new version of the module within the next couple of days.
Comment #45
David_Rothstein CreditAttribution: David_Rothstein commentedBy the way, these changes which I included may be an independent bugfix (rather than strictly necessary for the patch), but some people above sounded like they might have been running into issues with the directory names as well, so I included this fix just to be safe.
The directory separator (i.e., '/') was extraneous, since
variable_get('plupload_temporary_uri', 'temporary://')
already contains all the slashes it needs. I don't think it hurt to have an extra one, but while I was in the code I just went ahead and removed it.Comment #46
David_Rothstein CreditAttribution: David_Rothstein commentedI'm pretty confident this works, so I decided to commit it. That way we'll be able to get a new release out soon.
http://drupalcode.org/project/plupload.git/commit/0920019
Comment #47
rikclout CreditAttribution: rikclout commentedAwesome David, looks like your latest patch is working excellent here, thanks a lot!
Comment #48
David_Rothstein CreditAttribution: David_Rothstein commentedGreat! Thanks for reporting back.