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.
Comments
Comment #1
kongoji commentedIn 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).Comment #2
kongoji commentedre-roll a cleaner version of the patch
Comment #3
roball commentedComment #4
decipheredNo longer supporting Drupal 6 issues for this module.