After running a drush update on my drupal 7 site, the php code that I use to bring in user information for a form executes twice. This is a problem because I have created some functions in the php that get called so when it executes the PHP the second time it tries to re-declare the functions and I get errors like this:
PHP Fatal error: Cannot redeclare fooBar() (previously declared in [path_to_drupal7]/modules/php/php.module(80) : eval()'d code:3) in [path_to_drupal7]/modules/php/php.module(80) : eval()'d code on line 4
It doesn't matter what the function is called or what it does. In this example case this is the code:
<?php
function fooBar() {
print "foo bar";
}
fooBar();
?>
It also doesn't seem to matter what content type the page is (I my case I need it to bring user information into a form).
Why is Drupal executing the PHP twice? And more importantly, how can I keep it from doing so?
EDIT: Drupal seems to be executing the php once for the trimmed version and once for full version and once for the full version. This is what I expect when I preview the post. I don't really care about the preview version so I would be happy to get rid of it. Why is Drupal executing the code twice when I view the page? (why is it running it for the trimmed version when I'm actually viewing the page?)