wymeditor_nodeapi incorrects type
bear_beavis - October 14, 2008 - 22:09
| Project: | WYMeditor |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi,
Got an issue running cron.php (with retease module) : Cannot use object of type stdClass as array in [anonymised_path]/modules/wymeditor/wymeditor.module on line 185
Should be solved with that code :
function wymeditor_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'presave':
if ($node->files) {
$path = file_directory_path();
$files = $node->files;
foreach ($files as $file) {
$node->body = str_replace(file_create_url(substr($file->filepath, strrpos($file->filepath, 'temp'))), file_create_url($path .'/'. $file->filename), $node->body);
}
}
break;
}
}

#1
please close this issue
see http://drupal.org/node/332105