Posted by kongoji on June 8, 2011 at 4:13pm
1 follower
| Project: | File (Field) Paths |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | filefield paths, file_check_location, realpath, warnings |
Issue Summary
Hi,
After uploading an image file on a node and saving it, I got the following warnings:
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011/06 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011 in file_check_location() (line 236 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011/06 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011 in file_check_location() (line 236 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011/06/08 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/web155/web/immagini/2011/06 in file_check_location() (line 236 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011/06/08 in file_check_location() (line 230 of /var/www/mydocroot/includes/file.inc).
Warning: realpath() [<a href='function.realpath'>function.realpath</a>]: Unable to access /var/www/mydocroot/myfield/2011/06 in file_check_location() (line 236 of /var/www/mydocroot/includes/file.inc).So, I did a debug on the module and I discover an error on the use of explode function and I notice that at node saving it never add the file_directory_path() to the field path.
HOW TO REPRODUCE:
- create a node type with an imagefield field
- in the field settings, in "Filefield Path settings" field set the path to myfield//[yyyy]/[mm]/[dd]
- add a new node of that type and upload an image
- save the node
I attached a patch that fixed the problem for me.
| Attachment | Size |
|---|---|
| filefield_path-warnings.patch | 843 bytes |
Comments
#1
In the post before I incorrectly wrote
myfield//[yyyy]/[mm]/[dd](double slash after "myfield"), but I just mispelled, actually the real path I used to reproduced the problem wasmyfield/[yyyy]/[mm]/[dd](single slash).#2
re-roll a cleaner version of the patch