I'm 100% new to creating Drupal themes, so please bear with me. I'm getting errors before I even enable my theme, and I have no idea why.
First, I read through http://drupal.org/node/171194 & http://drupal.org/node/171205, then made a .info file that looks like this:
name = Litmus
description = Litmus is a theme by Devon Young, intended for experimenting and learning how to create Drupal themes.
screenshot = litmus.gif
core = 7.x
version = "7.x-3.x-dev"
engine = phptemplate
regions[header] = Header
regions[highlighted] = Highlighted content
regions[help] = Help
regions[content] = Content
regions[sidebar_first] = First sidebar
regions[sidebar_second] = Second sidebar
regions[footer] = Footer
features[] = logo
features[] = name
features[] = slogan
features[] = mission
features[] = node_user_picture
features[] = comment_user_picture
features[] = search
features[] = favicon
features[] = primary_links
features[] = secondary_links
As I understand it, I've just made an absolute minimal theme, since a .info is the only required file, so there shouldn't be any errors. I stuffed my files (litmus.info, litmus.gif, style.css) into a folder and then uploaded the folder to the themes area. Now, when I go to the admin "appearance" area to enable the theme, I get this listing of errors and I'm clueless what's causing it....
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 909 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 909 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 909 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 909 of /home/dfy1/public_html/modules/system/system.admin.inc).
Warning: uasort() [function.uasort]: Array was modified by the user comparison function in system_themes_page() (line 131 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 140 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 158 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 159 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 207 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 213 of /home/dfy1/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in theme_system_themes_page() (line 2657 of /home/dfy1/public_html/modules/system/system.admin.inc).
I've been searching for an answer to this for the past hour and haven't found any answers.
Comments
Try these 2 things first
1) Ensure that you placed your new theme in /sites/all/themes/
If that /themes folder isn't there, then create it & put your custom/contributed themes within. While this shouldn't be the reason for your errors, it's a "best practices" approach to including contributed/custom themes (& modules). Besides it being a best practices approach, it'll save you hours of hair-pulling when you have to upgrade Drupal core (i.e. not having to touch the /sites folder).
2) Clear all caches
These 2 should get you on the right path.
Miguel Hernandez - www.migshouse.com
Founder & CEO - The OpenMindz Group
Writer- Linux Journal & TechZulu
One more thing to add: Is the
One more thing to add:
Is the folder name of your theme exactly what you called your .info file? (i.e. litmus, same case?)
High Rock Media | Drupal Photography | Skype: highrockmedia | Twitter
Missing name
As the error messages indicate the name of your theme is missing from the .info file.
Please double check the .info file, maybe you accidentally delete or commented out the 'name = Litmus' line from that (comments are started with semicolons in .info files).
I tried both and received the same errors you mentioned above.
br - phpro
Check your character encoding
I've seen similar errors when my .info files (for modules in this case, but I imagine it applies equally to themes) were saved on a Windows machine and then uploaded to a Linux server.
Re-creating the files in the native editor on Linux (nano, vi, etc.) fixed the errors for me. Saving them in a compatible format (ANSI in Notepad++ seems to work) should also suffice.
carriage returns
@acy76 I'd guess your right. The carriage return that Windows saves in a document is \R. Linux uses \N as a carriage return. If you save a document in Windows without checking your format, you'll get runtime errors, especially with PHP.
one more thingy
Carriage return and UTF8 format is very important, but in my case converting from Win (CR and LF) to Unix (only LF) format wasn't enough.
I had to add one line of comment at top of .info file, e.g. "; comment".
I was making Bartik subtheme and this eventually worked. Strange.
--
Polish Drupal Forum - http://drupal.pl
personal site - http://palikowski.net
tutorials site - http://elimu.pl
THEME_NAME.info file
This problem can also occur in the case of bad formatted .info file inside the theme. So another thing you can try is:
This problem was caused while developing a D7 theme on a Windows machine. I guess it's somewhat related to what @jessebeach and @acy76 mentioned.
Hope it helps. Happy theming!
Sandu Camerzan
I found this angle to the problem
I experienced the "Undefined index: name in system_sort_modules_by_info_name()-errors", when i was following the theming guide for the Zen-theme. (The readme.txt file)
To Subtheme Zen, one has to copy a sample STARTERKIT folder and rename the folder and an info file, to the new subthemes name. After i did that i got approx. 10 "Undefined..." errors. When i removed the subthemes folders, all worked fine again.
After trying to figure out, what went wrong i finally discovered, that the owner of all the files in the subtheme was "root". The owner of the other drupal files, is someone else - lets call him "webu".
After changing the owner from "root" to "webu" all the errors disapeared.
Though all was able to read from the files when root was the owner - it apparently is not enough. The theme system must do some writing or executing, since it did not work with readable rights.
The reason for the errors are, that many like I, upload a theme through Drupals Themesystem. This will work with the proper rights, because it is the web-user that does the filework. When i copy a folder - i typically log ind with ssh, and there i am another user - in this case root.
Hope this helps others, with this problem
File ownership was the issue
I had this when creating a sub-theme from Marinelli.
All my drupal files are owned by "drupal" and the web server runs as "apache".
Once I changed the group of all files to "apache" and made sure they were all group-writable, the problem went away.
Gulp .info file!
Hi! I had the same problems. In my case there were gulp folder with .info file in it. Drupal thinks that that file is about new theme. I removed this folder and deleted MySQL string about that "theme".
Regards!