4

In Drupal 7.12 i use pathauto, cleanurls, transliteration, i18n.

When i edit one node i saw that, "Generate automatic URL alias" in unchecked. Then i checked other nodes and saw that for all type of nodes it became unchecked.

I'm pretty sure that it was checked until last week.

The last modifications i made: I updated Pathauto module, installed Transliteration, installed Debug Cron module.

So, how can i re-enable this checkbox in node settings page automatically ?

(Of course i can i that manually, by editing every node, and checking the check-box)

Thank you very much for your help.

6

If you have Pathauto installed, it will generate path aliases for your nodes. It unchecks the box when there's already a path alias, letting you know that it won't change the alias if you change the content. You can change this behavior with the 'Update action' setting here: /admin/config/search/path/settings

  • Thank you for help. In my settings this was checked "Create a new alias. Leave the existing alias functioning." Should i check another one? – trante Feb 18 '12 at 20:55
  • Depends on whether you want to generate a new URL every time the node is edited. – paul-m Feb 20 '12 at 2:33
3

Read the documentation page on How does Pathauto determine if the 'Automatic URL alias' checkbox should be checked or not?.

If the checkbox is unchecked on existing nodes it means that the current alias for the node does not match the alias that Pathauto "would" generate for the node. Maybe if you changed the patterns for your nodes, it would mean they're "out of sync" with the real patterns and then Pathauto un-checks the checkbox by default.

  • This is a great insight and a useful documentation link. We regularly see nodes losing the checkbox, even despite the fact that pathauto_persist is on. Remaining problems we see: 1) how should the user notice that some nodes (often among tens of thousands) became unchecked, 2) how to check them back on without hacking about in the database. – Vacilando Nov 27 '14 at 10:29
3

if you want to force it, even if it's unchecked,just create a module as follow :

<?php
function pathauto_checkbox_node_presave($node){
  global $user;
  if($node->type=='you_content_type'){
    $node->path['pathauto']=1;
  }
}
?>

if you want for every type just remove the "if" condition

  • I think this code needs to save again the node.Is this possible to force that without saving the node?thanks – sokratis Mar 11 '13 at 11:05
  • It's been a while now, but I think if you do a bulk update, it should be okay. – GwenM May 6 '13 at 0:36
1

Also you can do it using:

$node->path['pathauto'] = TRUE;
0

Some of my contents url were manually generated , some other not. I wanted to homogenize all content by content types and did not want to do it one by one

I have defined patterns in

admin/config/search/path/patterns

then

  delete all alias and did a bulk update

this action reset all content to automatically generated alias

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.