Currently, if a user creates a node which for some reason evaluates to an empty alias (eg, [menupath-raw] is the alias and the node wasn't added to the menu), then when editing the node later no alias will ever be created unless the user explicitly ticks the 'Automatic alias?' checkbox.

In this case, the logic in pathauto_form_alter will always set $node->pathauto_perform_alias to false because of a check on isset($node->path) (line 285).

          $pathauto_alias = pathauto_create_alias('node', 'return', $placeholders, "node/{$node->nid}", $node->nid, $node->type, $node->language);
          $node->pathauto_perform_alias = isset($node->path) && $node->path == $pathauto_alias;

I believe that user expectations would be for the 'Automatic alias?' checkbox to be selected by default in this case, as an empty path is equivalent to the empty alias which was previously generated.

          $pathauto_alias = pathauto_create_alias('node', 'return', $placeholders, "node/{$node->nid}", $node->nid, $node->type, $node->language);
          $node->pathauto_perform_alias = (isset($node->path) && $node->path == $pathauto_alias) || (!isset($node->path) && $pathauto_alias == '');

Comments

dave reid’s picture

Status: Active » Closed (won't fix)

I don't think we can or should support this. If the user created a node but didn't put it in the menu, then it wouldn't create an alias. Think of the automatic aliasing for the node turned off now. If I go back and re-edit the node and add it to a menu item, it makes sense that I would have to specifically re-enable automatic aliasing for it.

As such, I'm marking this issue as won't fix.