Hi,

I'm having a weird issue with this module. When applying the module to the default Image Field in a default Drupal setup (and setting it for multiple files) it works flawlessly, but when trying to add this to a custom Image field of my own making I keep getting these errors:

    Notice: Undefined index: tmppath in filefield_sources_plupload_element_value() (line 140 of /home/domain/public_html/sites/all/modules/filefield_sources_plupload/filefield_sources_plupload.module).
    The specified file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
    The specified file . could not be uploaded. Only files with the following extensions are allowed: png gif jpg jpeg.
    Notice: Undefined index: tmppath in plupload_element_validate() (line 235 of /home/domain/public_html/sites/all/modules/plupload/plupload.module).

Uploading the same files one by one however works, just as uploading them to the default Image Field Drupal originally provided.
Anyone have an idea on what could be the problem?

Comments

davidee’s picture

subscribe

b-prod’s picture

Category: bug » support
Status: Active » Closed (works as designed)

It seems that this bug is caused by an old version of PHP. I had the same error message on one of my servers, but not on the others. I just upgraded PHP and Apache on the server where the upload failed and after that it worked perfectly.

SilviaT’s picture

I currently have the same error, but this happens on a server where PHP and Apache versions coincide with the one I have on localhost. On localhost the problem doesn't occur.
Haven't found a fix yet.

SilviaT’s picture

Issue summary: View changes
Status: Closed (works as designed) » Active

Setting as active, hoping somebody has a solution.

arthitst’s picture

subscribe

arthitst’s picture

This might be caused by Suhosin POST-variable lengt restrictions in Suhosin.

Try adding this to your php.ini-file:
suhosin.request.max_varname_length = 128
suhosin.post.max_name_length = 128

ref:https://drupal.org/comment/7785873#comment-7785873

annblack’s picture

we have the same problem as well. Not using suhosin. I was previously using mupload (sandbox) module to provide a widget wrapper for plupload (https://drupal.org/sandbox/vingborg/1138512) and was trying to move over to filefield_sources_plupload. Using mlupload we did not have this problem. I am experiencing the issue of it complaining about the file type and refusing to upload the files only when uploading multiple files to a field of File type - uploading a single file is fine. We have Image fields that work fine with multiple file uploads. These are not custom field types.

subscribe.

knalstaaf’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Category: Support request » Bug report
Priority: Normal » Major
Issue summary: View changes

I'm having the same issue:

    Notice: Undefined index: tmppath in filefield_sources_plupload_element_value() (line 140 of /home/domain/public_html/sites/all/modules/filefield_sources_plupload/filefield_sources_plupload.module).
    The specified file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
    The specified file . could not be uploaded. Only files with the following extensions are allowed: png gif jpg jpeg.
    The specified file . could not be uploaded. Only files with the following extensions are allowed: png gif jpg jpeg.
    Notice: Undefined index: tmppath in plupload_element_validate() (line 235 of /home/domain/public_html/sites/all/modules/plupload/plupload.module).

(It also makes notice of file extensions not being allowed, but they are.)

Working on PHP 5.3.27, but I'm doubting that it has something to do with it - it works for other Plupload fields on my installation, and more significantly: the problematic field already had pictures uploaded through Plupload. Also: it works when I create a new node and adding pictures to that very field.

How this happened:

I have two Plupload fields in my node. I uploaded multiple fields to the first field, but the pictures actually had to be uploaded to the second Plupload field of that node (both already had pictures uploaded through Plupload before this occured). So I clicked the "edit" tab of that node so it would undo the uploaded files. Then I tried to upload them to the correct field, with the error above as a result.

Flushed cache, ran cron, no result. Renaming the files before uploading doesn't work either - same error notice. There's also another notice sometimes: For security reasons, your upload has been renamed to .. (sic).

Uploading the files one by one doesn't work either, as a result this particular field is locked for all the nodes and there's no way I can update the pictures.

Not sure if it's of any relevance, but this project is not live yet, so it resides on a domain like this http://subdomainof.host.com/~mysite.

(Temporary solution: disable Plupload for that field and use Drupal's default upload method or another multiple upload module)

knalstaaf’s picture

I may have a clue.

After testing every thinkable setting that may cause this, it occured to me that this happens to fields with a machine name longer than 20 characters ("field_" included).

So if you create a new field, and its label counts more than 15 characters, make sure the machine name doesn't exceed the maximum of 20 characters in total - edit it manually while creating.

Edit: I'm not sure about the exact amount of characters since the troubeld field from the previous post counted 20 characters in total (just not exceeding the alleged maximum). But with testing using just zero's in the machine name (field_00000000000001 = maximum), the above conclusion is valid.

Anyway: keep your field's machine name as short as possible until this bug has been fixed.

hephaestus’s picture

I can confirm that using a machine name with 20 or more characters is causing this issue for us. Fields with less than 20 characters in their machine name work fine, fields with 20 or more characters result in the error mentioned in the original report.

tmetzger’s picture

Happening to me as well. I have three such fields on one content type, and only the one with a long name has this problem. Name is field_learning_tracks (which is 21 characters if I'm counting correctly).

This works nicely on my local, with PHP 5.4.24. Only fails on my production setup, running PHP 5.3.3-7+squeeze14.

Going to try upgrading Prod, to see if that helps.

cthshabel’s picture

I have had this issue for a while. And it is not related to field length for me. It seems related to the fact the the default upload form is still rendered on DOM (even if checkbox is unchecked for default upload). Basically what happens is the form field input for the default upload is empty and it throws an error since it is submitted also with the submission of plupload form field input. That's why the error only references "." since there is no name or file type at all. At least this seems like the problem. I have tried to unset the default upload form array but it is the parent to plupload so it can't be unset without hiding everything.

My issue is on:

php5.5.10
Drupal 7.31

Let's figure this one out!

scotty’s picture

Same issue, was happening with one image field on my site but not with another image field. Turns out the broken field had name length of 22 and the working field had name length of 16. Removing the field name with length of 22 and replacing it by a field with name of length 17 solved my problem.