Hello,
I recently upgraded to Drupal 6.x-dev following the recomendations of the latest CCK release (http://drupal.org/project/cck) , and since then I'm getting the following message each time I create/modify a node including an empty FileField:
notice: Undefined property: stdClass::$filepath in F:\Drupal\sites\all\modules\filefield\field_file.inc on line 193.
I check that line of code and its just: $files[$file->filepath] = $file;
Is the problem just that Drupal 6.x-dev (being still in development) is more verbose than 6.2?
Should I just add some checking like isset($file->filepath) , to avoid the warning?
Any help/advice will be welcome. Thanks in advance!
Jose
Comments
Comment #1
Antoine Lafontaine commentedI also confirm this message. I've consistently got it when deleting an image from a field (using filefield_image) and saving the changes.
I've also noticed that the file on the server would be left untouched (not deleted) I was wondering if this was "per design" or could qualify as a bug. (I apologize if this is off topic, I'm not sure if this is related or not to this issue)
As always, thank you for your help.
Comment #2
jpetso commentedThe -dev versions of Drupal have error reporting of PHP E_NOTICE errors enabled, which causes Drupal to complain about more stuff than the released versions (e.g. 6.2) do. That's expected, still we should strive not to produce any E_NOTICE errors by ourselves. So this is a valid report.
If the filepath property is not set when this line is encountered, that would be a bug. Just avoiding the warning by checking on its existence would be the wrong solution, instead we need to find out why the filepath is not set.
Files not being deleted might be related, but is indeed offtopic in an issue about E_NOTICE errors. If you can reproduce this error under certain circumstances, please open a separate issue.
Comment #3
jlrubio commentedThanks a lot for the quick response. I'm not an expert, but I'll try to track why the filepath property is unset, anf I'll report here if I find an answer.
At least now I know that I can disable E_NOTICE errors as a last option :-)
Comment #4
bomarmonk commentedI am also getting similar notices after upgrading to the Drupal 6.3 development version (only mine reference variables and indexes):
* notice: Undefined variable: node in C:\xampp\htdocs\mysite\sites\all\themes\pixture\page.tpl.php on line 63.
* notice: Undefined variable: file in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 598.
* notice: Undefined variable: file in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 598.
* notice: Undefined index: flags in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 486.
* notice: Undefined variable: file in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 598.
* notice: Undefined index: flags in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 486.
* notice: Undefined index: flags in C:\xampp\htdocs\mysite\sites\all\modules\contemplate\contemplate.module on line 174.
Comment #5
jpetso commentedYeah, but please understand that contemplate is not really in scope for the filefield issue queue. You might want to file these notices in the contemplate issue queue instead.
Comment #6
bomarmonk commentedOf course-- sorry about that...
Comment #7
drewish commentedare you seeing this warning with an optional field when no file is present?
Comment #8
jlrubio commentedExactly, it's an optional filefield, and the message appears only when I create/update the node leaving that field empty.
Comment #9
dopry commentedFilefield has been rewitten since beta1/2. This issue is no longer applicable.