The bit of code that checks to see if the pathauto path that is created during validation is a dupe(-# is added) only works if pathauto has set the $node->path variable which doesn't happen in validation. So this will cause the creation to validate but disallow a node update.

This only happens if you do not assign a domain specific value.

I am not sure if we should be checking this here, maybe just a notice? The path that would be assigned to the node is handled by pathauto already and just added a (-#).

  if ($count) {
    // If there are no aliases for the active domains, we have to ensure
    // that this is not a duplicate alias.
    $domains = array_filter($node->domains);
    $set_paths = array_filter($paths);
    if (empty($domains)) {
      form_set_error('domain_path', t('The path alias is already in use. You may provide a domain-specific alias below.'));
      $set_message = TRUE;
    }
    elseif (empty($set_paths)) {
      foreach ($domains as $domain_id) {
        $key = ($domain_id == -1) ? 0 : $domain_id;
        form_set_error("domain_path][$key", t('The path alias %alias is already in use. You should provide a domain-specific alias.', array('%alias' => $alias)));
        $set_message = TRUE;
      }
    }
  }

Comments

grndlvl’s picture

Title: Validation logic is only working on saved nodes. » Validation logic is only working on saved nodes
agentrickard’s picture

Does this happen before or after applying the patch in #1412938: Allow domain path-auto support?

grndlvl’s picture

Before, I commented all that out to be sure.

I can give steps to replicate later.

grndlvl’s picture

[edit] doh! completely wrong issue...

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new4.51 KB

Right. Here's a patch to simplify all that. We had been checking to see if pathauto appends a numeric string to the end of the alias. I removed that.

Currently in client testing.

agentrickard’s picture

StatusFileSize
new5.52 KB

Simplified patch.

agentrickard’s picture

Status: Needs review » Fixed

Committed and pushed to beta4.

   7ae9ace..236255b  7.x-1.x -> 7.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.