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: 

User Points

User Pointsモジュール

概要: 

サイト内でさまざまアクションによりユーザのポイントを付加・削除することができるAPIとして機能します。

Category: 

Rules

モジュールのページ: 

ダウンロード: 

必要なモジュール: 

特になし

インストール: 

スクリーンショット

member1というユーザのポイント設定管理画面

ユーザ権限

 

備考: 

パッチや改善情報

Voting APIを使って、投票する場合、ユーザが一度、投票したかをデータベースに保存していないようなので、保存するようにするパッチの情報です。この機能は、Voting API の 7.x-2.x-dev 版でサポートされているように思いますが、インストールしてみるとワーニングとmy Votes results などの機能で不具合がありました。

エラーサンプル

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT NULL ) AND (.uid = '1' ) )) ORDER BY timestamp DESC' at line 1

7.x-3.x-devもページ表示が白くなる不具合がありました。2014年4月15日現在、Voting APIのバージョンがいくつかあります。結局、7.x-2.11を使います。

 [1]  :  7.x-3.x-dev  -  2013-Oct-19  -  Supported, Development
 [2]  :  7.x-2.x-dev  -  2014-Feb-27  -  Development
 [3]  :  7.x-2.11     -  2013-Mar-22  -  Supported, Recommended,

https://drupal.org/node/1269614

役立つ情報: 

設定方法の説明

以下のサイトでは、Voting Rules の設定をUser Pointsと一緒に行う場合です。

http://s1l.org/userpoints-voting-rules

上記のサンプル設定を、Drupal 7.26 Voting API 7.x-2.11+8-dev  rate 7.x-1.7  Voting riles 7.x-1.0-alpha1  Rules 7.x-2.6  Userpoints7.x-1.0  Userpoints_contrib 7.x-1.x-dev などでの環境です。

実際に、Rateウィジェットで作成した投票をした場合の結果