UploadPath conflict with Workflow
Alpha5 - November 6, 2008 - 16:02
| Project: | Upload path |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi, I use uploadpath and workflow module together.
But when i use workflow tab to change state it get error:
Fatal error: Cannot use object of type stdClass as array in C:\wamp\www\modules\uploadpath\uploadpath.module on line 36
Although if I use "Edit" tab to change state, it ok.
Can you resolve this conflict ?
Upload path Ver 6.x-1.0
Workflow Ver 6.x-1.0-rc3
Sorry, because I don't know to ask for support in Uploadpath module or Workflow module.

#1
Looks like a bug in uploadpath module where it is not handling the case where a node is being updated via node_save() programatically instead of through the node form?
#2
Seem this module do not have support. I will try other module.
#3
Have patience ;-)
Please try this patch to see if it fixes the problem, you'll need to edit your uploadpath.module file
This is for the D6 version
<?php/**
* Implementation of hook_nodeapi().
*/
function uploadpath_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
case 'update':
if( !in_array($node->type, variable_get('uploadpath_excluded_node_types',array())) ){
if(isset($node->files) && user_access('upload files')) {
foreach ($node->files as $key => $file) {
// INSERT THIS
if(is_object($file)){
$file = (array)$file; // if object then type cast as array
}
// rest of the code....
?>
#4
Hi, I have try your patch and it worked great. Thanks for your support.
<?php/**
* Implementation of hook_nodeapi().
*/
function uploadpath_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
case 'update':
if( !in_array($node->type, variable_get('uploadpath_excluded_node_types',array())) ){
if(isset($node->files) && user_access('upload files')) {
foreach ($node->files as $key => $file) {
// INSERT THIS
if(is_object($file)){
$file = (array)$file; // if object then type cast as array
}
// rest of the code....
?>
#5
committed to dev branch
#6
Automatically closed -- issue fixed for two weeks with no activity.