Rules_FAQ

Rule モジュール関連

Rulesモジュールおよび関連のモジュールや使い方、学び方、FAQなど。

FAQ

drushコマンドでアップデイト時にエラーになる、例えば、xxxxx/modules/rules/modules/node.rules.inc, line 147 などで止まってしまう場合

参考にしたサイト https://drupal.org/node/2090463

環境: Drupal 7.23

まずエラーのRulesモジュールを削除  rm -rf rules

drush cron

drush dl registry_rebuild

drush rr   <--- registry-rebuild

最新版のRulesモジュールを再インストール  drush pm-download rules

drush updb  <-- updatedb

drush cc all

drush cron   

以上でRulesモジュールをデータベースに再設定できることになります。最後の段階で、もし、ccやcronなどでエラーになる場合は、一度、rulesモジュールをモジュールのディレクトリから削除して。アップデイトやその他の作業を行い、正常動作を確認してから最新版のrulesモジュールをダウンロードします。

用語の説明: 

registry-rebuild

Rebuild the registry table (for classes) and the syste table (for module locations) in a Drupal install.

updatedb (updb)

Apply any database updates required (as with running update.php).

Registry-Rebuild  <--- モジュールではありません

https://drupal.org/project/registry_rebuild

There are times in Drupal 7 when the registry gets hopelessly hosed and you need to rebuild the registry (a list of PHP classes and the files they go with). Sometimes, though, you can't do this regular cache-clear activity because some class is required when the system is trying to bootstrap.

When would you need Registry Rebuild?

You might get something like:

「PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11"PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11"」

If this happens when you're trying to run update.php, and happens when you're trying to clear your cache, well, you have some trouble. That's what Registry Rebuild is for.

It also may happen that you've moved some module that Drupal requires to bootstrap, and you get a horrible error. Registry Rebuild will also rebuild the system table to get the modules in the right place so you can bootstrap.

How To Use Registry Rebuild With Drush

This is the preferred technique, and it should work with multisite installs.

You can just drush dl registry_rebuild and drush will download it into your .drush folder. (Alternately, you can obtain the package another way and copy the folder into .drush yourself.)

Make a backup of your database.

On a multisite install, cd into the site you're rebuilding, as in cd sites/mymultisite

drush rrdrush rrdrush rrdrush rrdrush rr

 

 

 

CMS: