10
Mar
Mar
Almost all Drupal developers have encontered this issue when they were trying to move a module from one enviroment to another or when they copied the module folder into a wrong directory.
What is code registry in Drupal 7?
Drupal 7’s code registry is an inventory of all classes and interfaces for all enabled modules and Drupal's core files. The registry stores the path to the file that a given class or interface is defined in, and loads the file when necessary.How can I notice if my registry is broken?
Well, that's easy. You can get an error that looks like: PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11
How can I fix my broken registry?
Luckily, fixing the registry is quite easy with Registry Rebuild, which is not a Drupal module but a script which rebuilds all your website registries.First of all, making a database backup is recommended because your registry table will be overwritten. For the backup you can use drush sql-dump >dump.sql or mysqldump -uuser -ppassword dbname >dump.sql or use phpMyAdmin.
From your console download via drush the registry rebuild project drush dl registry_rebuild or just unzip the project into sites/all/modules/.
After that run drush registry-rebuild, drush rr or cd sites/all/modules/registry_rebuild php registry_rebuild.php. If you don`t use a terminal just call http://example.com/sites/all/modules/registry_rebuild/registry_rebuild.php into your browser.
If you get a message that looks like the one below then your registry has been rebuilt.
DRUPAL_ROOT is /var/www/example.
Bootstrapping to DRUPAL_BOOTSTRAP_SESSION
Bootstrap caches have been cleared in DRUPAL_BOOTSTRAP_SESSION
Doing registry_rebuild() in DRUPAL_BOOTSTRAP_SESSION
Bootstrapping to DRUPAL_BOOTSTRAP_FULL
Rebuilding registry via registry_rebuild_cc_all in DRUPAL_BOOTSTRAP_FULL
All caches have been cleared with registry_rebuild_cc_all.
Deleted 1 stale files from registry manually.There were 1111 files in the registry before and 1110 files now.
All caches have been cleared with registry_rebuild_cc_all.
If you don't see any crazy fatal errors, your registry has been rebuilt.
Now go check your website. Enjoy!
Category View
Tags
activities
Aggregation
amazon
android
apache
API
appcelerator
application
assistant manager
backup
balance
brand recognition
business days
cache
camp
coding standards
command
commerce
community
context
cURL
customer engagement
customer portal
database
data integrity
deployment
developer
Drupal
drupal 7
drupal 8
Drupal Camp
Drupal Core
Drupal development
Drupal solution
Drush
e-commerce
events
filter
front-end developer
game
games
general
git
Global Training
google maps
integration
ios
job
Job fairs
jobs
kpi
maintenance
manual testing
memcache
mobile
mobile app
mobile application
mobile development
Module
modules
mysql
open source
Panels
performance
php
php developer
plans
project
project manager
promotion
qa
Quality Assurance
redis
registry
Relation
release candidate
remote team
responsibilities
responsive
screen resolutions
Scrum
Security
server
Services
session
skills
software
software testing
sprint
stock management system
studio
support
Targul de Cariere
team
team building
teambuilding
teamwork
testing
titanium
tutorial
Târgul de Cariere in IT
Unit Testing
update
Updates
usability
user experience
varnish
Views
Views Handler
web application
web application testing
web development
webservice
webshop
website usability