Fix screwy URL aliases for project_issue nodes

/ Published in: MySQL
Save to your folder(s)

I currently have project_issue nodes set for replacement pattern issues/issue[nid] in Drupal 5.x PathAuto. This query fixes all of the URL aliases for entries created before this was set correctly.

Copy this code and paste it in your HTML
  1. UPDATE url_alias SET dst = REPLACE(src,'node/','issues/issue') WHERE src IN (SELECT CONCAT('node/', CAST(nid as CHAR)) FROM node WHERE type = 'project_issue') AND dst NOT LIKE 'issues/issue%';

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.