I'm trying to learn Drupal and am still in the very early stages. I installed Drupal 7 on my website www.chasingbutterfliesdesign.com and added a little content. It showed up fine. I then decided to try my hand at theming and uploaded Zen and created my new theme "cbd" based on it. I started uploading a couple of modules and suddenly broke my site. I got the following error message:

Fatal error: require_once(): Failed opening required '/home/chasingb/public_html/sites/all/themes/zen/panels-layouts/zen-no-wrapper/zen_no_wrapper.inc' (include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /home/chasingb/public_html/sites/all/modules/ctools/includes/plugins.inc on line 477

I looked at the this file, /home/chasingb/public_html/sites/all/modules/ctools/includes/plugins.inc
but I don't quite understand what I'm supposed to add to it.

thanks for any hints you can send my way.
Sheryl


[Line 443]// Iterate through all the plugin .inc files, load them and process the hook
// that should now be available.
foreach (array_filter($file_list) as $module => $files) {
if ($filename) {
$files = isset($files[$filename]) ? array($filename => $files[$filename]) : array();
}
foreach ($files as $file) {
if (!empty($info['info file'])) {
// Parse a .info file
$result = ctools_plugin_process_info($info, $module, $file);
}
else {
// Parse a hook.
$plugin = NULL; // ensure that we don't have something leftover from earlier.

if (isset($plugin_arrays[$file->uri])) {
$identifier = $plugin_arrays[$file->uri];
}
else {

require_once DRUPAL_ROOT . '/' . $file->uri;
// .inc files have a special format for the hook identifier.
// For example, 'foo.inc' in the module 'mogul' using the plugin
// whose hook is named 'borg_type' should have a function named (deep breath)
// mogul_foo_borg_type()

// If, however, the .inc file set the quasi-global $plugin array, we
// can use that and not even call a function. Set the $identifier
// appropriately and ctools_plugin_process() will handle it.
if (isset($plugin)) {
$plugin_arrays[$file->uri] = $plugin;
$identifier = $plugin;
}
else {
$identifier = $module . '_' . $file->name;
[Line 477] }
}

$result = ctools_plugin_process($info, $module, $identifier, dirname($file->uri), basename($file->uri), $file->name);
}
if (is_array($result)) {
$plugins = array_merge($plugins, $result);
}
}
}
return $plugins;
}

Comments

Sam Moore’s picture

Chances are the issue isn't in the Ctools code - more likely something happened upstream from there.
Does /home/chasingb/public_html/sites/all/themes/zen/panels-layouts/zen-no-wrapper/zen_no_wrapper.inc actually exist?

Also, can you get into your site at all? Maybe the admin pages?

Do you have any level of comfort with the command line? Maybe drush?

sheryl_the_librarian’s picture

The zen folder had been in /home/chasingb/public_html/sites/all/themes
and I got this message
Fatal error: Cannot redeclare zen_no_wrapper_settings_form() (previously declared in /home/chasingb/public_html/sites/all/themes/cbd/panels-layouts/zen-no-wrapper/zen_no_wrapper.inc:26) in /home/chasingb/public_html/sites/all/themes/zen/panels-layouts/zen-no-wrapper/zen_no_wrapper.inc on line 26

so I had moved the folder to public_html/themes but then got the error message I posted before.

I can get to the files from the cpanel, but I can't login to the Drupal admin part of my site.
I don't know drush.

yelvington’s picture

A few "don'ts" may help:

Don't move folders around. (Put everything back and CLEAR CACHE).

Don't put anything in /themes. That directory belongs to core.

Don't forget to RENAME FUNCTIONS when you copy a file from zen to your derivative theme. In your case, zen_no_wrapper_settings_form() should be cbd_no_wrapper_settings_form() .

To get back into your system you will need to disable cbd and switch back to a working theme. You can force matters by editing your site's settings.php file and (temporarily) adding the following line:

$conf['theme_default'] = 'garland';

Once you do that you should be able to log in again, clear cache (admin/settings/performance), fix your mistake, then remove that line.

sheryl_the_librarian’s picture

Thanks for the suggestion. I tried to insert the line into the settings.php file, but when I tried to save it, it said I didn't have permission to make changes.
I also tried to rename it so that I could create a new file that I could edit, but it wouldn't let me do that either.

arulraj’s picture

You can change your default theme with a drush command, for example

# for Drupal 6/7
drush vset theme_default garland

# for Drupal 8 (Drush 7+)
drush config-set system.theme default bartik

Then, clear or rebuild your CSS/JS and theme caches. If the problem theme still appears, check that it has not been forced in your settings.php file.

If drush fails with an error, it is likely you have other problems with the installation besides or in addition to the theme, such as an incompatible module.
Method 2: Change the active theme in the database

The default theme setting is stored in Drupal's database, and thus can be changed by manipulating the database from the command line or an administration overlay or client like PHPMyAdmin or MySQL Workbench for MySQL.

Always make a backup of your database before changing values in it directly, as it is possible to destroy data and render your site unrecoverable at the database level. You have been warned.

In Drupal 6 and 7, the setting is stored in the system table:

# activate a trusted theme
UPDATE system SET status=1 WHERE name = 'garland';

# change the default setting
UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';

# clear the cache tables

TRUNCATE cache;
TRUNCATE cache_bootstrap;
TRUNCATE cache_block;

Note that 's:7' refers to the length of the following string. Modify as needed. This is database surgery, tricky stuff.

If you are using per-user themes, and you've just messed it up for yourself as admin, try

UPDATE users SET theme='garland' WHERE uid = '1';

In Drupal 8, the setting is in the config table, and stored as a blob value for system.theme.

sheryl_the_librarian’s picture

I've spent the morning watching videos on how to install drush and am feeling lost. My site is hosted on A2 hosting and I have cpanel.
One of the videos said that I could upload drush through pear but its not listed on the the available modules and when I copied and pasted the url for the drush .tar file, the installation failed.

I have putty and tried to login to my site from there following the A2 instructions, but couldn't connect - I got my screen, but no cursor or login and it wouldn't accept any command.

It looks like drush doesn't have a windows installer any more.

If I just reinstall Drupal, will it overwrite the files and let me into the site again?