Various "Undefined" notices on content admin screen I get these sporadically on the content admin screens.  These seem to be referencing fields that I do have in my templates, that are working just fine for those actual screens.  I just don't get why this content admin screen would be looking for those values.

Here are the error messages:

•   Notice: Undefined property: stdClass::$field_pcast_fname in include() (line 64 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/node.tpl.php).
•   Notice: Undefined variable: messages in include() (line 13 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/comment-wrapper.tpl.php).
•   Notice: Undefined index: field_twithandle in include() (line 14 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/user-profile.tpl.php).
•   Notice: Undefined variable: field_headshot in include() (line 24 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/user-profile.tpl.php).
•   Notice: Undefined offset: 1 in include() (line 94 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/user-profile.tpl.php).
•   Notice: Trying to get property of non-object in include() (line 94 of /mnt/drive2/vhosts/ainonline.com/httpdocs/drupal/sites/all/themes/ain_core/templates/user-profile.tpl.php).


And for example, the field_twithandle code that's in my user-profile.tpl.php:

&lt;?php if($user_profile['field_twithandle']) { ?&gt; 
    &lt;div class="profile_twitfollow"&gt;
        &lt;a href="http://twitter.com/&lt;?php print $field_twithandle[0]['value']; ?&gt;" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false"&gt;Follow @&lt;?php print $field_twithandle[0]['value']; ?&gt;&lt;/a&gt;
        &lt;script src="http://platform.twitter.com/widgets.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;/div&gt;
&lt;?php  } ?&gt;
Try this, check to make sure it's set first:

&lt;?php if (isset($field_twithandle[0]['value'])): ?&gt;
&lt;a href="http://twitter.com/&lt;?php print $field_twithandle[0]['value']; ?&gt;" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false"&gt;Follow @&lt;?php print $field_twithandle[0]['value']; ?&gt;&lt;/a&gt;
&lt;?php endif; ?&gt;


The problem is that those values aren't set on some pages, which is why you're getting the error. So that's a fix for an undefined index error. You also have things like undefined variable, for which a fix could be like:

&lt;?php if (isset($messages)): ?&gt;
  /* Do stuff here with $messages */
&lt;?php endif; ?&gt;