We get the following warnings after the file has finished uploading only when the case tracker module is installed.

* warning: Invalid argument supplied for foreach() in /var/www/html/modules/node/node.module on line 521.
* warning: implode(): Bad arguments. in /var/www/html/modules/node/node.module on line 525.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /var/www/html/includes/database.mysql.inc on line 172.

Comments

drenton’s picture

Below is a backtrace. Looks like it is failing on this line from the casetracker.module because of an empty node id :

$node = isset($form['nid']['#value']) ? node_load($form['nid']['#value']) : NULL;

So does this look like a casetracker bug? Should I post it on that module?

Thanks

warning: Invalid argument supplied for foreach() in /var/www/html/modules/node/node.module on line 521.
Array
(
[0] => Array
(
[file] => /var/www/html/includes/common.inc
[line] => 552
[function] => drupal_set_message
[args] => Array
(
[0] => warning: Invalid argument supplied for foreach() in /var/www/html/modules/node/node.module on line 521.
[1] => error
)

)

[1] => Array
(
[function] => error_handler
[args] => Array
(
[0] => 2
[1] => Invalid argument supplied for foreach()
[2] => /var/www/html/modules/node/node.module
[3] => 521
[4] => Array
(
[param] =>
[revision] =>
[reset] =>
[nodes] => Array
(
)

[cachable] => 1
[arguments] => Array
(
)

)

)

)

[2] => Array
(
[file] => /var/www/html/modules/node/node.module
[line] => 521
[function] => node_load
)

[3] => Array
(
[file] => /var/www/html/sites/all/modules/casetracker/casetracker.module
[line] => 1081
[function] => node_load
[args] => Array
(
[0] =>
)

)

[4] => Array
(
[file] => /var/www/html/sites/all/modules/filefield/filefield.module
[line] => 821
[function] => casetracker_form_alter
[args] => Array
(
[0] => filefield_js
[1] => Array
(
[field_customfield] => Array
(
[#type] => fieldset

.
.
.
.
.

dopry’s picture

Project: FileField » Case Tracker
Version: 5.x-2.2 » 5.x-1.x-dev

This looks like case tracker issue.

STyL3’s picture

i'm getting the same error but for 5.x-1.3-beta1:

warning: Invalid argument supplied for foreach() in C:\wamp\www\drupal\modules\node\node.module on line 521.

warning: implode() function.implode: Invalid arguments passed in C:\wamp\www\drupal\modules\node\node.module on line 525.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE  in C:\wamp\www\drupal\includes\database.mysql.inc on line 172

Anyone know how to fix this?

drenton’s picture

Do you have the CCK filefield module installed ?

http://drupal.org/project/filefield

STyL3’s picture

yes. is this the cause of the issue?

drenton’s picture

This is what I did for a workaround.

diff -up casetracker.module.orig casetracker.module

--- casetracker.module.orig
+++ casetracker.module
@@ -1078,7 +1078,7 @@ function casetracker_comment_changes($ca
* Implementation of hook_form_alter().
*/
function casetracker_form_alter($form_id, &$form) {
- $node = isset($form['nid']['#value']) ? node_load($form['nid']['#value']) : NULL;
+ $node = !empty($form['nid']['#value']) ? node_load($form['nid']['#value']) : NULL;

// add case options to our basic case type.
if (in_array(str_replace('_node_form', '', $form_id), variable_get('casetracker_case_node_types', array('casetracker_basic_case')), TRUE)) {

STyL3’s picture

i'm assuming this is a patch of some sort? i'm not exactly sure what it is i'm supposed to do with it. i'm a drupal noob.

drenton’s picture

Yeah, I just changed one line in the casetracker.module file.

Look for the casetracker_form_alter function (line 1080 in my code) and change this :

$node = isset($form['nid']['#value']) ? node_load($form['nid']['#value']) : NULL;

to this :

$node = !empty($form['nid']['#value']) ? node_load($form['nid']['#value']) : NULL;

STyL3’s picture

you're awesome! I just swapped it out and will report back once i do some testing! thanks again.

zero2one’s picture

Assigned: Unassigned » zero2one
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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