Closed (fixed)
Project:
File (Field) Paths
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2012 at 22:01 UTC
Updated:
3 Jul 2013 at 09:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #0.0
Bernsch commentedimage name
Comment #1
sw3b commentedI got the same thing on my side with the same modules ! Except for the name, my file are getting rename correctly. I'm using the token as below.
Comment #2
Bernsch commentedApparently there is a plup issues
--> link to Plup Issues
Comment #3
decipheredGoing to mark this as a duplicate for the moment, unless someone is able to confirm that this issue is reproducable without the Plup module in the mix, or with a fixed version of Plup.
Comment #4
carajito commentedNote: The mistake was mine at the token name
Hi, I have the same error and I not use Plup or any other module
Drupal: 7.14
File (Field) Paths: 7.x-1.0-beta3
In the content type is ok but on the taxonomy have the error:
The error be show when I use more than one image
File path = [term:url:unaliased:args:first]/[term:url:path]
File name = [file:ffp-name-only-original].[file:ffp-extension-original]
Thanks for the module
Comment #5
skizzo commentedI am re-opening the issue as I see the error when saving a node with a single imagefield and multiple image instances.
I am not running Plup and for testing purposes I am using the default file name configuration for the image field.
I believe that the error is generated only when "File path" is left blank.
Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of /var/www/drupal/sites/all/modules/filefield_paths/filefield_paths.module).Comment #6
brightboldI can confirm that like @skizzo in #9, I was getting this error without Plup installed and setting a file path, which had previously been blank, resolved it.
Comment #7
im_lex commentedI also can confirm it. I was getting this error without Plup installed...
Comment #8
hanskuiters commentedConfirmed without the Plup module. Setting the filepath in the image field solves this issue, but the final filepath might get a bit messy. It is related to the path the image cache sets, so my final image path becomes http://localhost:8888/sitename.nl/sites/default/files/styles/thumb-news/...
Comment #9
john bickar commentedPatchy attachy.
Comment #10
yannickooI'm getting even an error with this patch attached:
As I mentioned in this issue I tried it with file_create_url() and I no more got notices but no I've
public:///in the uri column.Comment #11
a.mikheychik commentedTo fix this issue, you need to set "File path" option. If it isn't set, the path won't be parsed correctly by parse_url function.
Comment #12
Renee S commentedJohn Bickar, the patch just pushes the problem a few lines down when the module looks for $replacement and can't find it, since the if condition wasn't met...
Comment #13
jaydub commentedIn my testing with a simple core imagefield the issue with the calls to parse_url() in _filefield_paths_replace_path($old, $new, $entity) is that the paths that are passed ($old and $new) to parse_url() are using Drupal's file stream wrappers so in this case $old and $new are using the public:// scheme and so the code that attempts to parse the uri that follows incorrectly parses 'host', 'path', etc.
The attached patch uses file_create_url to convert the stream wrapper uri into something the parse_url() call can use.
Comment #14
torrance123 commentedThe patch in #13 works correctly.
In my case the value of
$newin_filefield_paths_replace_path()ispublic:///test_file.txt.Once it is passed through
parse_url()on line 290, the variable$infois set to empty.Using the patch in #13, the value of
$infobecomes:There are no ill side effects in my testing.
[Edit: corrected the code examples.]
Comment #15
torrance123 commentedThis bug only appears when there is no path set. With no path the value of
$newis:public:///test_file.txtWith a path set, in this case 'mycustompath', the value of
$newis:public://mycustompath/test_file.txtSo it looks like the triple forward slash is confusing
parse_url().Comment #16
Anonymous (not verified) commentedI couldn't apply the the patch from #13, it is not applicable. The code in 7.x-1.0-beta3 seems different than what the patch expects.
Comment #17
ssllav commentedhi all.
I do not use Plop and have Notice about host too.
But version 7.x-1.x-dev work excellent.
Comment #18
yannickooI can apply the patch against the dev version.
Comment #19
Renee S commentedWorks for me.
Comment #20
toomanypets commentedThe patch in #13 also resolves the problem I reported in comment 1 on #1830392: Bug triggered by files with space in the filename where the Insert module was inserting the incorrect path when the uploaded file contained spaces in the filename.
Comment #21
Jeffrey C. commentedIt's been three months and a RTBC patch is available, I suppose we should escalate this issue to critical since this module is currently in an unusable state right now.
Comment #22
decipheredReducing this from critical, it's far from critical, a critical issue implies the module breaks stuff, however this is just throwing a warning.
I'm also removing this issue as RTBC, because it's a bandaid patch, it doesn't resolve the real underlying issue. That, and I am unable to reproduce this issue.
If someone can give me a step-by-step guide on how to reproduce this issue I'd be extremely grateful and will get this issue resolved ASAP.
Comment #23
Jeffrey C. commentedIt only renames the file if you submit the node creation form directly. Doesn't work if you click the upload button when creating a new node.
Comment #24
deciphered@Jeffrey C.,
File (Field) Paths doesn't do any renaming until the node is save, because how can it replace Node tokens if there is not yet a Node to provide the tokens? That's the whole point of the module. I assume I'm taking your comment out of context however, because it doesn't necessarily seem to be related to my last comment.
Comment #25
Jeffrey C. commentedHmm... That makes sense. Weird thing though, like a couple weeks ago the file doesn't get renamed without the patch in #13. But just tested it out again and everything seems to work just fine. But any idea how the PHP notice is generated?
Comment #26
decipheredAs I said, I can't reproduce the issue, I don't get the message, I've gone through all the comments in the issues searching for information on what may have caused it for others, and attempted everything that's been said, but I am still unable to reproduce.
If you are able to get the message, tell me exactly what you are doing from the point of a fresh install of Drupal and then I might be able to get to the bottom of the issue.
Comment #27
Jeffrey C. commentedTry http://simplytest.me/project/filefield_paths. Then create an article.
Comment #28
decipheredOk, so I did that, and I tested both with 7.x-1.0-beta3 and 7.x-1.x, it was an issue in 7.x-1.0-beta3 but worked fine in 7.x-1.x.
Therefore this issue is fixed and closed.
Comment #29
claudiuv commentedThis bug is still active with 7.x-1.0-beta3 and the latest drupal core.
Comment #30
decipheredCaludiv,
The issue is fixed in 7.x-1.x-dev, it will be part of the next beta release or stable release.
Comment #32
miamitops commentedi just changed the configuration in drupal admin logging and errors not to display those errors
Comment #32.0
miamitops commentedtext correction