hook_pathauto_alias_alter() on bulk update EDIT: I've found out that this question doesn't make sense.
The problem isn't that the hook is not called during the bulk_update.
The problem is that the code generates unexpected aliases because of the "variable_set" request, which led me to think that the hook wasn't called.
See my answer for the correct code to programmatically set alias patterns.



I have created a function to alter the alias for a particular content type when certain conditions are met, using the following code:

function HOOK_pathauto_alias_alter(&amp;$alias, array &amp;$context) {

   if(isset($context['data']['node']-&gt;field_myfield['und']))
       variable_set('pathauto_node_contentype_pattern', 'something/[node:title]');
}


The problem is, when I create a node and save it, it works, but when i try to bulk update the aliases, it doesn't, and the default pattern set from the GUI is used instead.
Issue can be with the setting for Url aliases, when  you run the bulk update.
You need to keep it on the " Create a new alias. Delete the old alias. ". SO it will run update your old aliases. Please check if it works for you.