0

I've added the following methods to my module, saved, and flushed all caches on my site. I have double checked that my module is enabled and working properly in all other respects.

function xxxxxxx_path_insert($path) {
  kpr($path);
  var_dump($path);
}

function xxxxxxx_path_update($path) {
  kpr($path);
  var_dump($path);
}

function xxxxxxx_path_delete($path) {
  kpr($path);
  var_dump($path);
}

I want to receive notifications when content path aliases are updated so that I can store some info about them for my custom module. I just put these shell methods in place to ensure I was getting the hook calls and to double check the structure of the $path variable.

Then I edited an existing piece of content. I changed the title and saved the node. Since I'm also using pathauto, that module updated the content path alias to point to a new url based on the new title. I did not receive any of the calls.

Ok, so I figured maybe the auto generation of the alias was the problem, so I edited the piece of content, disabled the auto generation of the path alias and changed the path alias to something by hand. Then saved the node. I did not receive any of the calls to the above hooks.

What am I doing wrong? Why aren't these hooks getting called?

The hook documentation for your reference: path.api.php

0

sigh I flushed all caches a TON of times and it would never call my hooks. I had to completely disable my module, flush all caches, and then re-enable my module.

Then the system saw my hooks.

sigh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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