Warning: Invalid argument supplied for foreach()
OS X users may notice warnings such as these suddenly appearing in their (remote) Drupal install:
warning: Invalid argument supplied for foreach() in /path/to/drupal/includes/theme.inc on line 435.
warning: Invalid argument supplied for foreach() in /path/to/drupal/includes/theme.inc on line 442.This problem is caused by using Textmate to directly modify Drupal files on a mounted network drive. Textmate tries to store some information about edited files (such as the caret position) in hidden files, but in some environments the names of these files will be mangled. For example, '._myfile.php' becomes ':2e_myfile.php'. Besides the aforementioned warnings, the presence of such files will also cause other unexpected behaviour in Drupal.
Solution
Run the following command in a new terminal window to prevent Textmate from creating hidden files on network drives:
defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1Of course, you'll still have to manually track down and delete any existing files. You'll need a shell connection for this, as these files are invisible in Finder.
