How can I modify the result of the core Path listing filter? The core Path module defines the page admin/config/search/path which gives a listing of all path aliases. 

The menu hook in the module calls the path_admin_overview function in path.admin.inc which makes the query to retrieve a list of URL aliases:

$query-&gt;condition('alias', '%' . preg_replace('!\*+!', '%', $keys) . '%', 'LIKE');


What I would like to do is somehow intercept this query and modify the condition in a custom module (to avoid hacking core, of course). To be more precise, I want to make it possible to extend the condition to search the source column as well as the alias column as indicated above.

My first thought was to intercept the Path admin listing form: path_admin_filter_form which I have done using hook_form_alter. I was then hoping that somehow I could override the existing submit handler or attach an second one which would call path_admin_overview, but of course I cannot directly modify that core function.

So it seems like I would have to make my own custom copy of path_admin_overview and modify the code inside, then have that called instead. Of course this doesn't feel right either - since if the Path module changes, the module will fall behind.

Is there some kind of hook or pattern I can employ here to modify the query in path_admin_overview or otherwise achieve the goal indicated in bold in a standalone module?

EDIT: It looks like it could be possible if the query in path_admin_overview was tagged (it isn't currently), see here: https://www.drupal.org/node/310077#hook_query_alter
You can override admin/config/search/path path using hook_menu_alter
and use a custom function as menu callback.

function oyurmodule_menu_alter(&amp;$items) {
  $items['admin/config/search/path']['page callback'] = 'mymodule_custom_path_admin_overview'; 
}


Then your mymodule_custom_path_admin_overview shoud be a copy of path_admin_overview with your needed alterations.

This is not optimal as you should keep your function code in sync with original code, so any patches applied to path_admin_overviewfunction should applied to your altered function, but is the only way you can alter the functionality without hacking core.