0

I'm setting up a Drupal Bootstrap subtheme, and ran into this fatal error when trying to clear my cache. Something seemed to want to redeclare a bootstrap preprocess function:

Error: Cannot redeclare bootstrap_preprocess_region()

This caused the whole site to go down and Drush to fail any time I tried to clear or rebuild the cache.

Why is this happening?

0

This was happening because I'd copied .func.php files from the templates folder of the Bootstrap parent theme into my base theme alongside .tpl.php files. Bootstrap is relatively unusual in that it has files in the templates folder alongside tpl files that will break the site if they're treated like standard theme tpl files.

While the .tpl.php files are to be copied as normal, to override the contents of the other files, you are expected to copy their appropriate contents into your subtheme's template.php file or into a new .func.php file, and substitute your subtheme name for the bootstrap part of the function name.

There's some more information on the theme registry docs page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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