2012-02-23 6 views
1

新しいアクションを作成する予定のuserbeep_action_info()フックに2番目の要素を追加しましたが、[トリガー]ページで確認すると表示されません。最初の項目、userbeep_beep_actionが表示されますが、2番目の項目は表示されません。どうしてこれなの?それは表示するために余分な情報が必要な設定が可能なのでしょうか?私の本は、この段階でその存在を確認するよう頼んだが、現れていない。Drupal 7 - 私のアクションがトリガーメニューに表示されないのはなぜですか?

<?php 

/** 
* @file 
* Writes to the log every time a user logs in or edits a node. 
*/ 

/** 
* Implementation of hook_action_info(). 
*/ 
function userbeep_action_info() { 
    return array(
     'userbeep_beep_action' => array(
      'type' => 'system', 
      'label' => t('Beep annoyingly'), 
      'configurable' => FALSE, 
      'triggers' => array('node_view', 'node_insert', 'node_update', 'node_delete') 
     ), 
     'userbeep_multiple_beep_action' => array(
      'type' => 'system', 
      'label' => t('Beep multiple times'), 
      'configurable' => TRUE, 
      'triggers' => array('node_view', 'node_insert', 'node_update', 'node_delete') 
     ) 
    ); 
} 

/** 
* Simulate a beep. A Drupal action. 
*/ 
function userbeep_beep_action() { 
    watchdog('beep', 'Beep! at ' . ''); 
} 
+1

私はあなたが使用している本を知っています。あなたは将来の参照のためにこのサイトをブックマークしたいと思うでしょう - http://www.drupalbook.com/errata_overview – SpaceBeers

+0

ありがとう、これは問題を解決しました。 – persepolis

+0

ようこそ。それが助けになったら、以下の答えを受け入れてください。これはすべての間違いから離れてよい本です... – SpaceBeers

答えて

3

からhttp://www.drupalbook.com/errata3

Error: The screenshot in Figure 3.4 is of the wrong overlay. (What is shown in Figure 3.4 is not available until an instance of the advanced action has been created as described on pp. 43-44 and in Figure 3.5.)

Correction: What should be shown in Figure 3.4 is the overlay accessed by clicking the Configuration link in the top menu and then clicking on the Actions link in the Configuration page, and finally scrolling to the bottom of the overlay to the "Create an Advanced Action" drop-down select box.

あなたのコードが動作していないことを、あなたの仮定を基づかしている図は、正しいものではありません。この章の残りの部分を完了すると、それが機能するようになります。上記のリソースを使用して、本のエラーを詳細に調べてください。

ヒント:かなりの数がありますが...

0

高度(設定)アクションが作成され、一度設定されたコードで定義する必要があるので、それが表示されない:ような単純なアクションはない/admin/config/system/actions、。また、構成フォームとアクションも最初に定義する必要があります。ブックのエラー修正サイトから

関連する問題