? hyphen_remove_default_and_warn.patch ? nohup.out ? pathauto_path_redirect.patch Index: pathauto.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/Attic/pathauto.inc,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 pathauto.inc --- pathauto.inc 21 Oct 2007 11:45:48 -0000 1.1.2.8 +++ pathauto.inc 21 Oct 2007 15:42:08 -0000 @@ -208,6 +208,7 @@ function pathauto_create_alias($module, break; // Replace old alias - remember the pid to update case 2: + case 3: $pid = $data->pid; $oldalias = $data->dst; break; @@ -306,10 +307,22 @@ function _pathauto_set_alias($src, $dst, // Skip replacing the current alias with an identical alias if ($oldalias != $dst) { path_set_alias($src, $dst, $pid, 1, 10); + if (variable_get('pathauto_update_action', 2) == 3 && function_exists('path_redirect_save')) { + if (isset($oldalias)) { + $save['path'] = $oldalias; + $save['redirect'] = $src; + $save['type'] = 301; //moved permanently + path_redirect_save($save); + $redirect = TRUE; + } + } if ($verbose and user_access('create url aliases')) { - if ($pid) { + if ($redirect) { + drupal_set_message(t('Created new alias %dst for %src, replacing %oldalias. %oldalias now redirects to %dst', array('%dst' => $dst, '%src' => $src, '%oldalias' => $oldalias))); + } + elseif ($pid) { drupal_set_message(t('Created new alias %dst for %src, replacing %oldalias', array('%dst' => $dst, '%src' => $src, '%oldalias' => $oldalias))); - } + } else { drupal_set_message(t('Created new alias %dst for %src', array('%dst' => $dst, '%src' => $src))); } Index: pathauto.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v retrieving revision 1.44.4.36 diff -u -p -r1.44.4.36 pathauto.module --- pathauto.module 19 Oct 2007 00:55:15 -0000 1.44.4.36 +++ pathauto.module 21 Oct 2007 15:42:09 -0000 @@ -131,11 +131,22 @@ function pathauto_admin_settings() { '#default_value' => variable_get('pathauto_max_bulk_update', 50), '#description' => t('Maximum number of objects of a given type which should be aliased during a a bulk update. The default is 50 and the recommended number depends on the speed of your server. If bulk updates "time out" or result in a "white screen" then reduce the number.')); + $actions = array( + t('Do nothing, leaving the old alias intact'), + t('Create a new alias in addition to the old alias'), + t('Create a new alias, replacing the old one')); + if (function_exists('path_redirect_save')) { + $actions[] = t('Create a new alias. Redirect from old alias.'); + } + elseif (variable_get('pathauto_update_action', 2) == 3) { + // the redirect action is selected, but path_redirect is not enabled + // let's set the variable back to the default + variable_set('pathauto_update_action', 2); + } + $form["general"]["pathauto_update_action"] = array('#type' => 'radios', '#title' => t('Update action'), '#default_value' => variable_get('pathauto_update_action', 2), - '#options' => array(t('Do nothing, leaving the old alias intact'), - t('Create a new alias in addition to the old alias'), - t('Create a new alias, replacing the old one')), + '#options' => $actions, '#description' => t('What should pathauto do when updating an existing content item which already has an alias?')); $disable_transliteration = TRUE;