Check for value in filefield

Events happening in the community are now at Drupal community events on www.drupal.org.
el_reverend's picture

Is there a way to check if a file or files have been uploaded in a content type? I'm trying to determined if a picture has been uploaded.

I have tried to check if a filefield contains a value, but I am getting an error message that my argument #2 is not an array in the cck content.rules.Inc file.

Any hints? How can I do that with php?

Comments

Currently trying this, but

el_reverend's picture

Currently trying this, but that doesn't seem to work? I am told by rules that the variable $node does not exist...

return isset($node_unchanged->field_profile_pic)

Any ideas? Hints?

PHP filter enabled?

itangalo's picture

Do you have the PHP filter up and running on your site?
If so, try

<?php
dpm
($node_unchanged);
?>
to check out the object, or
<?php
dpm
(get_defined_vars());
?>
if you can't find any object to check out.

Good luck!
//Johan Falk, NodeOne, Sweden