[support] Anonymous user does not have access to view

Scott scott at bscottholmes.com
Thu May 14 15:34:44 UTC 2009


I have created a CCK content type that contains a field defined as a
node reference. The value in this field is available to logged in users
but not to anonymous users. I'm defining a variable thus:

 $coupon = $node->field_coupon[0][view];

then later testing for a value, thus:

 <?php if ($coupon): ?>
   <div id="coupon" class="field field-type-nodereference
field-field-coupon">
 <?php print "Print ". $node->field_coupon[0][view] . " for " .
$node->field_coupon_terms[0][value]; ?></div>
 <?php endif; ?>

$coupon has a value for logged in users but not for anonymous users.  I
do have the nid value available ($node->field_coupon[0][nid]) so it is
possible to select the referred to node by selecting from the database
but I'd rather not if I don't have to.

Thanks, Scott



More information about the support mailing list