warning: Invalid argument supplied for foreach() in /home/content/i/n/d/indievidual/html/modules/node/node.module on line 521. 
warning: implode() [function.implode]: Invalid arguments passed in /home/content/i/n/d/indievidual/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 /home/content/i/n/d/indievidual/html/includes/database.mysql.inc on line 172. 

This appears when I try to preview a custom content type, not on any default page or story preview.

This is my code for the node -

<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
	<?php if ($page == 0) { ?><div class="nodeTitle<?php if (!$picture) {print ' nobreak';}?>"><a href="<?php print $node_url?>"><?php print $title?> - <?php print $node->field_artist[0]['view']?></a></div><?php }; ?>
	<div class="content" style="min-height:150px;">
  <img src="<?php print $node->field_image_url_0[0]['view']?>" height="150px" width="150px" style="float:left;padding-right:5px;padding-bottom:5px;"alt="<?php print $node->field_artist[0]['view']?>"/>
  <?php if ($picture) { ?>
    <?php if ($page == 0) { print '<div class="clearpic"></div>'; } ?><?php print $picture; ?>
  <?php } ?>
  <?php $fullnode = node_load($node->nid);
	print check_markup($fullnode->body, $fullnode->format, FALSE);
  ?>
  <a href="<?php print $node->field_url[0]['view']?>">Last.fm</a><br />
  <a href="http://en.wikipedia.org/wiki/<?php print $node->field_artist[0]['view']?>">Wikipedia</a>
  </div>
  </div>	
	<div class="linkswrap">
	<?php print $submitted?>
	<?php if ($links) { ?><div class="postlinks"><?php print $links?></div><?php }; ?>
	<?php if ($terms) { ?><div class="taxonomy">Tags: <?php print $terms?></div><?php } ?>
	</div>

When I submit the actual page it works fine and doesn't throw any errors. Am I missing something in the node code?

Comments

zeta ζ’s picture

  <?php $fullnode = node_load($node->nid);
    print check_markup($fullnode->body, $fullnode->format, FALSE);
  ?>

I guess this is the bit causing the problem. If you use the $node variable passed to the node rather than $fullnode, I think that will work better. Also, used correctly, it will already be checked for you.

See http://drupal.org/node/11816

The preceding bit is probably not quite what you intended. Try;-

  <?php if ($picture) { ?>
    <div<?php if ($page == 0) { print ' class="clearpic"'; } ?>><?php print $picture; ?></div>
  <?php } ?>

___________________
It’s in the detaιls…

demonstration portfolio