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
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

jvandyk - November 6, 2008 - 17:35
Project:Workflow» Upload path
Version:6.x-1.0-rc3» 6.x-1.0

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

Alpha5 - November 7, 2008 - 08:32

Seem this module do not have support. I will try other module.

#3

davidwhthomas - November 7, 2008 - 09:11

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

Alpha5 - November 7, 2008 - 15:53

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

davidwhthomas - November 8, 2008 - 23:24
Status:active» fixed

committed to dev branch

#6

System Message - November 22, 2008 - 23:32
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.