Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
So, in that other issue I was planning on doing it in a way that turned out to be overly difficult. But, there is a php way that I can do this. (so I don´t forget later, here are the notes...)
The basic system is to check a certain group (limited by range, or some other way) and do a drupal_get_path_alias on them and if they come back negative then delete the alias...I will need to figure out how to break it apart, of course, and also how many I can do at a time.
Turns out that this might not work for 5.x. Currently pathauto determines if something is an existing path using this little test:
static $menu = NULL;
if (is_null($menu)) {
$menu = menu_get_menu();
}
// Determine the menu item containing the callback.
return isset($menu["callbacks"][$path]);
That's not really all that reliable, but it covers the major things. Because it's not reliable, it obviously is not suitable for this purpose.
In Drupal6 we menu_valid_path to check this for us. So, I'm afraid this might have to be a 6.x only feature unless there is some other way to figure this out...
Also, I realized that this should probably either be easy to undo OR should not do anything on its own. e.g. it should present a list of items ready for deletion and require manual intervention to actually delete them OR it should copy them to a backup table and only then delete them OR a combination of the two. But deleting things on cron without admin intervention feels mighty dangerous.
I don't think this feature would be appropriate for Pathauto. It's a lot harder challenge to figure out if/how paths are no longer valid. Marking as postponed unless the other maintainers agree this should be a won't fix. Hopefully greggles isn't insulted if I unassign him from this issue.
Comments
Comment #1
mightyiam commentedI've been told that http://drupal.org/node/128366 is a similar issue.
Comment #2
gregglesYes, the eventual goal of that one is the same.
Comment #3
gregglesSo, in that other issue I was planning on doing it in a way that turned out to be overly difficult. But, there is a php way that I can do this. (so I don´t forget later, here are the notes...)
The basic system is to check a certain group (limited by range, or some other way) and do a drupal_get_path_alias on them and if they come back negative then delete the alias...I will need to figure out how to break it apart, of course, and also how many I can do at a time.
Comment #4
gregglesI think this would be a nice thing to do so I'm assigning it to myself for 5.x-2.1.
If someone needs it sooner than I get to it, feel free to provide your own patch.
Comment #5
mightyiam commentedgreggles++
Comment #6
gregglesTurns out that this might not work for 5.x. Currently pathauto determines if something is an existing path using this little test:
That's not really all that reliable, but it covers the major things. Because it's not reliable, it obviously is not suitable for this purpose.
In Drupal6 we menu_valid_path to check this for us. So, I'm afraid this might have to be a 6.x only feature unless there is some other way to figure this out...
Also, I realized that this should probably either be easy to undo OR should not do anything on its own. e.g. it should present a list of items ready for deletion and require manual intervention to actually delete them OR it should copy them to a backup table and only then delete them OR a combination of the two. But deleting things on cron without admin intervention feels mighty dangerous.
Comment #7
dave reidI don't think this feature would be appropriate for Pathauto. It's a lot harder challenge to figure out if/how paths are no longer valid. Marking as postponed unless the other maintainers agree this should be a won't fix. Hopefully greggles isn't insulted if I unassign him from this issue.
Comment #8
gregglesIt takes more than that to insult me ;) I totally agree with you on this.
Comment #9
dave reid