dongyi6543 2016-01-18 08:22
浏览 73
已采纳

Drupal的webform模块没有使用webform.api.php

I'm working with the Webform module of Drupal 7 and I'm trying to modify the hook_webform_submission_presave in the webform.api.php , but it seems that the module is not using this file because I've made modifications but doesn't change anything.

Do I have to say to Drupal in any place to use this file? Or what do I have to do?

  • 写回答

2条回答 默认 最新

  • duanpo2037 2016-01-18 09:14
    关注

    First, I hope that you know that you shouldn't change module files directly, but to add hook function to your module and change that "hook" at beginning of function name with your module machine name.

    Second, you have to clear all the caches so Drupal will re-scan your module and figure out that there is new hook function and start using it.

    So, you have to create your own module first:

    https://www.drupal.org/developing/modules/7

    Don't be scared - It's just a folder with an info file describing your module and module file it self (in minimal case).

    Then, if your module is called "anna" you should create a function inside your module file and name it:

    anna_webform_submissions_presave()

    And clear the cache - after that Drupal should start calling your hook function.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?