<div dir="ltr">Nancy, I tend to do the following (using body as an example) in pseudo standard data import script.<div><br></div><div><div>$body = $wrapper-&gt;body-&gt;value();</div><div>if (empty($body)) {</div><div>  // Do something, for example set a value to avoid Undefined variable notices</div>

<div>  $wrapper-&gt;body-&gt;set(array(&#39;value&#39; =&gt; &#39;&#39;));</div><div>}</div><div>// Now I can deal with the data as if it were populated.</div><div>if ($wrapper-&gt;body-&gt;value-&gt;raw() != $this-&gt;Body) {</div>

<div>  $wrapper-&gt;body-&gt;set(array(&#39;value&#39; =&gt; $this-&gt;Body, &#39;format&#39; =&gt; &#39;full_html&#39;));</div><div>}</div></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><br>

</div>Lucas<div><a href="http://www.mtechinformationsolutions.com" target="_blank">MTech, LLC</a></div></div></div>
<br><br><div class="gmail_quote">On Mon, Aug 12, 2013 at 12:25 PM, Nancy Wichmann <span dir="ltr">&lt;<a href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif"><div><span>With fields I often do:</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif">

<span><span style="font-family:Courier New,courier,monaco,monospace,sans-serif">  if ($vca = field_get_items(&#39;node&#39;, $node, &#39;field_corresponding_vca&#39;)) {<br></span></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:Courier New,courier,monaco,monospace,sans-serif">

<span><span style="font-family:arial,helvetica,sans-serif"><br></span></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><span style="font-family:arial,helvetica,sans-serif">This </span>makes sure
 there is some data before trying to do anything with it.</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br><span></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif">

<span>But I&#39;ve searched all over the place and even dug into the code. How do you do this with entity_metadata_wrapper? I want to give the users an error message that means something to them, and sometimes just set the value to zero.</span></div>

<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br><span></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif">

<span>I see that the Entity module
 has a protected function called &quot;dataAvailable&quot; but I can&#39;t use a protected function.<br></span></div><div> </div><div><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><b>Nancy</b></i></font> <br>

</div><div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div></div></div><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>