Undefined index errors only on one subdomain
Since you don't say anything about any debugging effort, it's hard to say, but one thing repeatedly stands out as clearly wrong

$node-&gt;field_X['und']['0']


which should always be

field_get_items($node, 'field_X);


Since your domains are foo.com, www.foo.com, foo.fr and www.foo.fr, this might indicate that you use more than one language, which is exactly when ['und']['0'] is likely to break for you. Notice that field_get_items() will return an array instead of a single value, so you will need to amend your code to deal with that.