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 1

Of 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.

Comments

Milkrow’s picture

I'm having this issue but I'm using BBEdit. I don't see any peculiar file names and I'm using BBEdit to view the server. I am not able to get the zen subtheme to load correctly (css isn't loading) and I can't determine what could be causing this. I've tried moving the location of Zen (I renamed it Zen from zen) and my sub-theme from sites/all/themes to themes/ and back again to see if that was the issue. I've also gone through the entire Starterkit README file to make sure I've done things correctly and it seems to be correct. I'm still getting the issues with theme.inc and no luck getting the subtheme to work. Can anyone help me shed some light on this?