Posted by leop on September 28, 2007 at 12:46pm
Jump to:
| Project: | Upload previews |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
When I preview a post with uploaded images (by clicking on the Preview button while editing) I get the following warning:
warning: Attempt to assign property of non-object in .../upload_preview/upload_preview.module on line 150.
Comments
#1
Leo, I just stepped into the same warning.
Do you have any additional finding on that?
I am running D5.6 and UP 5.x-1.x-dev (2008-Jan-16)
Thank you.
#2
No, sorry. I stopped using the upload preview module because it caused a lot of problems for users. They told me it had to do with javascript, but since it isn't an essential feature of my website, I disabled the module.
#3
This module does not use any JavaScript whatsoever.
#4
I just had the same error.
You can reproduce it by previewing a node with image attachments
I made a quick fix to prevent the code executing in preview mode
upload_preview.module line 150
from this:
<?phpforeach ($node->content['files']['#files'] as $fid => $file) {
$node->content['files']['#files'][$fid]->preview = module_invoke_all('upload_preview', $file);
}
?>
to this:
<?phpif($node->nid){
foreach ($node->content['files']['#files'] as $fid => $file) {
$node->content['files']['#files'][$fid]->preview = module_invoke_all('upload_preview', $file);
}
}
?>
hope that helps,
DT
#5
Needs to review for inclusion into the module.
Thanks
Robert
#6
Looks like a good simple patch included in CVS.
Thanks
Robert
#7
#8
Automatically closed -- issue fixed for two weeks with no activity.