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

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条)

报告相同问题?

悬赏问题

  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)
  • ¥15 无法使用此凭据登录,因为你的域不可用,如何解决?(标签-Windows)
  • ¥15 yolov9的训练时间
  • ¥15 二叉树遍历没有报错但无法正常运行
  • ¥15 在linux系统下vscode运行robocup3d上场球员报错
  • ¥15 Python语言实验
  • ¥15 SAP HANA SQL 增加合计行
  • ¥20 用C#语言解决一个英文打字练习器,有偿
  • ¥15 srs-sip外部服务 webrtc支持H265格式
  • ¥15 在使用abaqus软件中,继承到assembly里的surfaces怎么使用python批量调动