In Drupal 7, i want to put a additional code when the Save button is Clicked (Saving) in "a content" form (New or Edit).

I don't want to know the hook (because i don't want to make an obvious Custom Module). Because i don't want to let other users know the operation by having a obvious Custom Module which will be listing inside the Module Panel. So i want to make a Silent Customization inside the Existing Drupal Core Module (correspondence Function).

Thats why I just want to know the Function in the Core Modules which finally process the Node Save task.

  • Can anyone please describe which Function (in Core Modules) is finally processing the Drupal Node Save? (Save` finally may be for both New Item Insert or existing Item Edit.)

1 Answer 1



Now that's out of the way, let's continue.

The way I see it, you have a couple of options:

1) Use Rules.

The rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.

Although this will allow people to see that there is code being run.

2) Create a custom module, but in your info file make use of the hidden property:

As of version 7.x, modules and themes may specify that they should not be visible on the modules page by adding hidden = TRUE. This is commonly used with testing modules used with SimpleTest where end-users should never enable the testing modules.

  • (2) Create a custom module, but in your info file make use of the hidden property also create a separate physical module folder inside. So, for Rules, finally the point is, Can i run (set to call) my code when a Content is Saved/Edited, by using Rules? Oct 7, 2012 at 11:17
  • If you enable PHP filter then you can put your custom code in an action for rules.
    – Chapabu
    Oct 7, 2012 at 11:40
  • Although I'm not sure of any use case why you'd want to hide a custom module. If someone can see the fact that there's an extra module file there, then you're probably already screwed from a security point of view.
    – Chapabu
    Oct 7, 2012 at 11:41
  • Ya i know the risks and i've done 2~3 core customizations. So instead of discussion about risk now, can i please know about the thing i just want to know? Oct 7, 2012 at 11:47
  • 1
    Security through obscurity is a waste of time, concentrate on locking down the system through proper means (user permissions/file permissions/server-side settings). I'm not sure you'll find much assistance on hacking core here, I know I for one would try to talk anyone down from that particular suicide ledge...you could hurt yourself (and your site) up there :P
    – Clive
    Oct 7, 2012 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.