1

My .info file is prosperpro.info, but my theme's folder is named prosperpro8. I had not realized this difference because the code was working. When I realized this, and tried to changed the .info file back to prosperpro8.info, the code would no longer work.

I thought that the .info file required to have the same name of the theme's folder.

Am I wrong? If they must have the same names, how can I correct it? (Changing the file name will result in code break.)

2 Answers 2

1

You cant give same name for theme and module. I have found an article on drupal.org

How to Resolve module-theme name collision

When developing a site it can happen that a module and theme are being given the same name. This results in very weird behavior: overriding hooks can make your blocks disappear, print $content returns only 'array', hence disappearing admin interfaces which force us to alter the database to get back on track.

Now we have to find out how to remove the new theme and switch back to an old one. if your site is big, with lots of content, then reinstalling is not an option. I tested this with MySQL, so these hints are for MySQL only.

Make a backup of your database first. We are going to edit the dumped records, and reinsert the database. I used this method because using my favorite editor is way easier and safer than using MySQL shell (anyway we shouldn't edit a live site database).

The theme name is registered in the following tables in your database: system, variables and block. Clear the cache manually, meaning to remove all the INSERT INTO cache_ lines in order to see results. Change the 'default_theme' value in system. Note that 's' stands for string length, so be sure you put the string length after the 's:'. Also make sure you change the value to an existing theme (available themes are listed in system). And remove, or rename your troublesome theme.

The change in block is imperative, otherwise the blocks will not appear. Drop your old database from the sql server and insert the edited one. Voila, we have recovered from a theme crash.

© drupal.org

And

Never give a module and a theme the same name

Here's the D7 Patch

0

Here is the manual page for creating info files. - Structure of the.info file Those are the requirements for the .info file.

3
  • digital, i understand that. let me rephrase my question, if my themes folder is named "abc" must my .info file also be named "abc.info?
    – czchlong
    Commented Feb 29, 2012 at 21:59
  • 2
    No the folders can be called anything. Inside of the .info file you can name the theme what ever you like. Also, before checking any changes made to these type of files. Make sure you clear your cache. Commented Feb 29, 2012 at 22:03
  • 1
    I'm guessing that if your theme is set as default, then changing its folder name might break the code. You could try setting another theme as active before renaming the folder. Then rename the folder, then clear the cache. Commented Feb 29, 2012 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.