Closed (fixed)
Project:
Find URL Alias
Version:
5.x-1.3-3
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2007 at 11:15 UTC
Updated:
21 Jul 2009 at 21:11 UTC
It would be really nice to have feature that allows you to select a list of "orphaned aliases", restricted by node type, and to be able to bulk delete them. I have a very large database, with many orphaned aliases to test this on! All the other features are handy but don't lend themselves to finding orphans in bulk and then deleting them, though the Googlebot is quite helpful in regularly pointing them out.
Happy to clarify further, thanks
FC
Comments
Comment #1
starbow commentedYeah, that would be useful.
Comment #2
projectspoint commentedOK How about this?
To do the tidy up in mysql, I have been using this:
// counts up the orphans //
SELECT COUNT(substring(`src`, 6)) AS src_nid FROM url_alias LEFT OUTER JOIN node ON substring(`src`, 6)=node.nid WHERE substring(`src`,1,5)='node/' AND node.nid IS NULL LIMIT 0,100;
// 3 queries
CREATE TEMPORARY TABLE url_alias_deletes AS ( SELECT pid FROM url_alias LEFT OUTER JOIN node ON substring(`src`, 6)=node.nid WHERE substring(`src`,1,5)='node/' AND node.nid IS NULL
);
DELETE t1 FROM url_alias AS t1, url_alias_deletes AS t2 WHERE t1.pid = t2.pid;
DROP TABLE url_alias_deletes;
As far as I can see, it works
Hope this helps ...
FC
Comment #3
starbow commented