簡體   English   中英

表單提交鈎子處理程序未在drupal中被調用

[英]form submit hook handler not getting called in drupal

我有Drupal 7網站。 它具有名為say myproducts自定義模塊。 該模塊具有以下掛鈎

function myproducts_form_alter(&$form, &$form_state, $form_id) {

if(isset($form_id) && $form_id=='product_node_form')
{
   $form['#submit'][] = 'myform_form_submit';
}

}


function myform_form_submit(){
 echo 'test submit handler'; exit();
 }

但是`myform_form_submit`沒有被調用。

任何幫助,高度贊賞。

我沒有看到任何錯誤。 確保使用Drush( drush cc all )或通過Drupal的UI清除緩存。 之后,我將回顯$form_id以查看其實際值是多少。 我也建議使用devel模塊 非常適合調試!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM