I updated to latest release and got these error messages, when I uploaded a file

Notice: Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (line 45 of C:\xampp\htdocs\drupal\sites\all\modules\filefield_paths\modules\filefield_paths.inc).
Strict warning: Only variables should be passed by reference in filefield_paths_filefield_paths_process_file() (line 66 of C:\xampp\htdocs\drupal\sites\all\modules\filefield_paths\modules\filefield_paths.inc).
Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of C:\xampp\htdocs\drupal\sites\all\modules\filefield_paths\filefield_paths.module).

Now my uploaded files are not being redirected to where I want them to go instead they are being dumped in the public files. Before upgrading to latest release this worked (uploaded files where redirected to where they should go based on some replacement patter tokens.

Comments

deciphered’s picture

Status: Active » Postponed (maintainer needs more info)

It's always important to run update.php when updating a module, have you run update.php?

JoeJava’s picture

Yes, no pending updates on Database.

JoeJava’s picture

I just loaded an old version of my site used 7.x-1.0-beta1, uploaded file and was placed in correct subirectory.
I then updated to 7.x-1.0-beta3, uploaded a file and got the errors shown and file was put into public area.

gmclelland’s picture

I just got the following error on a fresh site
Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of /home/quickstart/websites/tester.dev/profiles/da7/modules/contrib/filefield_paths/filefield_paths.module). (x11)

It happened when I uploaded multiple images to an imagefield on a term using http://drupal.org/project/1115362 and http://drupal.org/project/multiupload_imagefield_widget.

gmclelland’s picture

Just tried the same thing with an multivalued imagefield on a term, but this time I tried using it with the http://drupal.org/project/plup module. Same errors
Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of /home/quickstart/websites/tester.dev/profiles/da7/modules/contrib/filefield_paths/filefield_paths.module). (x11)

adroid’s picture

I also confirm the error.

sw3b’s picture

Same for me with plup and multiupload_imagefield_widget.

deciphered’s picture

I just installed a fresh copy of D7 with File (Field) Paths beta1, set it up and uploaded, confirmed it worked, then upgraded to beta3, ran update.php then uploaded a second piece of content and everything worked perfectly....

Unless you give me a way to reproduce this issue I can't do anything.

Cheers,
Deciphered.

sw3b’s picture

after clearing cache and some magic dust the message disapear...

for me it do not make it anymore...

nico_2802’s picture

I experience exactly the same problem as described above. I did all the things, recommended here, have no pending database-uptades, everything is the latest version and it is generally a very simple installation with just a few extra modules installed. Yet, I get that error-message and I dont quite understand how it was solved by "clearing magic dust"... can u be more specific?

Appreciate any help!

deciphered’s picture

Hi china-design,

Not to sound rude, but confirming the issue does absolutely nothing to help resolve the issue. I accept that the issue is valid, but I was unable to reproduce the issue every time I attempted to, so unless someone actually decides to provide me with some specifics on their setup and provides me some guaranteed steps to reproduce the issue then there's absolutely nothing I can do about the issue.

I would be extremely grateful if you could take a few minutes of your life and try to help, or to put it in your own words; "can u be more specific?"

Cheers,
Deciphered.

gmclelland’s picture

@Deciphered - Here is the steps I took

Create a content type called "Image Gallery"
Add a field called "plup" type > "Image", widget > Plupload
Set File path to "galleries/[node:nid]/"

File Path Options
checked - Cleanup using Pathauto.
checked - Transliterate.

File name
[file:ffp-name-only-original].[file:ffp-extension-original]
File Name Options
checked - Cleanup using Pathauto.
checked - Transliterate.

checked - Enable Alt field

Number of values - Unlimited
using the public files

Using the latest Drupal and
Modules in use:
Media-2.x-dev
File Entity-2.x-dev
http://drupal.org/project/plup
filefield_paths - 1.0-beta3
plupload - 1.0-beta4

Here is the error I get when I create a node.

Notice: Undefined index: host in _filefield_paths_replace_path() (line 285 of /home/quickstart/websites/tester.dev/profiles/da7/modules/contrib/filefield_paths/filefield_paths.module). (x5)

Notice: Undefined index: scheme in _filefield_paths_replace_path() (line 287 of /home/quickstart/websites/tester.dev/profiles/da7/modules/contrib/filefield_paths/filefield_paths.module). (x10)

Notice: Undefined index: host in _filefield_paths_replace_path() (line 287 of /home/quickstart/websites/tester.dev/profiles/da7/modules/contrib/filefield_paths/filefield_paths.module). (x5)

I will try a standard image/file field to see if I can narrow down the problem. Let me know if you need any more information.

gmclelland’s picture

Just tried the same with type > "Image", widget > "Image"

This did not produce any errors when I saved the node.

gmclelland’s picture

gmclelland’s picture

I think this may only be happening with plup module + File Field Paths module. I can't seem to reproduce it with http://drupal.org/project/1115362 + http://drupal.org/project/multiupload_imagefield_widget + File Field Paths module.

Hope that helps

Fidelix’s picture

This has nothing to do with the module upgrade, I think.

I have this problem as well, and I'm using the plup module.

marcusn’s picture

I got rid of this error after disabling "File (Field) Paths"-module.

Bernsch’s picture

Status: Active » Postponed (maintainer needs more info)

I have the same Error-Message:
Notice: Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (Zeile 45 von C:\wamp\www\drupal\sites\all\modules\filefield_paths\modules\filefield_paths.inc).

I use the Multiupload Imagefield Widget Modul.

its the same issues?

Fidelix’s picture

Status: Postponed (maintainer needs more info) » Active

Since this is easily reproducible, I guess this is a confirmed problem, so I'm turning it back to active.
If the maintainer disagrees, please set the status back.

michelle’s picture

Status: Postponed (maintainer needs more info) » Active

I honestly don't know if my issue is the same. If it's not, I would be happy to file a new one. Here are the facts that I know:

  1. I have a node with an imagefield and it is set to put the files at this path: competitions/entries/[node:field-competition-id]/[node:field-competition-entry-class]/[node:field-competition-entry-category:name]
  2. When images are added, they are all dumped into "competitions". The rest of the path is ignored. They don't end up in "entries" which is what I would expect if this were a token failure.
  3. If I edit the field, change nothing, but check the "retroactive update" and save, all the images are correctly moved to where they belong.
  4. This was working correctly in a prior version, possibly beta 1 but I'm not sure. It broke after an update in December 2011. Because I only access these once a month, I didn't discover the problem until January.
  5. I am not using the Plup module others mentioned as a possible cause.
hass’s picture

Also have this warning. Just create a node, publish them directly and a red error is shown.

Error Strict warning: Only variables should be passed by reference in filefield_paths_filefield_paths_process_file() (Line 66 of sites\all\modules\filefield_paths\modules\filefield_paths.inc).
carl.ben’s picture

Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of /public_html/sites/all/modules/filefield_paths/filefield_paths.module).

I'm using Multiupload Filefield Widget.

Not using Multiupload Imagefield Widget (which is dependant on MFW).

Not using PLUP.

deciphered’s picture

Title: No longer uploading to proper path, getting error messages after module update » File (Field) Paths filename issue.
Project: File (Field) Paths » Plup
Version: 7.x-1.0-beta3 » 7.x-1.x-dev

Hi guys,

The problem is this:

1. To allow the resetting of the filename by token I store the original uploaded name to a new column in the file_managed table; 'origname'
2. Plup changes the filename before it hits filefield_paths_file_presave() (which is where the origname is stored), so the wrong filename is stored in the 'origname' column.
3. The default token set for filename is pulling the value from 'origname'

Therefore, this issue is actually not an issue with File (Field) Paths but is the expected behaviour. I'm sorry, but that is the truth of it.

I'm moving this issue into the Plup queue because it is the cause of this issue, and I believe it is their responsibility to fix the issue. I'm happy to discuss that point that.

Two proposed fixes:
1. Trigger hook_file_presave before File (Field) Paths and reset the filename
2. Update 'origname' in the database at some point.

 

Note: For those of you who have a non-Plup related issue, please point it out and I'll try to separate out the issue.

Cheers,
Deciphered.

hass’s picture

I'm NOT using Plup.

deciphered’s picture

@hass,

The error reported by you is in no way related to this issue, if you have a similar issue to this issue without Plup I'd be more than happy to fix it if you can provide me with some details and reproducable steps in a new issue. The only reproducable steps in this issue where using Plup and that issue is confirmed as mentioned above.

Unfortunately this is what happens when there are multiple unrelated issues in a single case.

Cheers,
Deciphered.

deciphered’s picture

P.s., some of the original issues in this case (undefined indexes) have been fixed and will be committed ASAP, but all further discussion in this issue is to be related to the Plup issue.

gmclelland’s picture

Thanks @Deciphered for checking on this. It seems like it is isolated to plup module only, I can't reproduce the error with the other modules - http://drupal.org/project/1115362 + http://drupal.org/project/multiupload_imagefield_widget

Bernsch’s picture

I got error on D7 with error below

Notice: Undefined index: host in _filefield_paths_replace_path() (row 285 von C:\wamp\www\drupal\sites\all\modules\filefield_paths\filefield_paths.module).

Notice: Undefined index: scheme in _filefield_paths_replace_path() (row 287 von C:\wamp\www\drupal\sites\all\modules\filefield_paths\filefield_paths.module).

I use:

Drupal: 7.12
Plup: 7.x-1.0-alpha1
File (Field) Paths: 7.x-1.0-beta3

and the image on the server gets a strange name --> p16nsnqa5e12o0134d1t951mbmmq94.jpg

The Bug is bevor i see/try Post #23.
--> link to file(field)path issues
ll try Post #23

Anonymous’s picture

Status: Active » Closed (fixed)