When you deploy entities from a content server to an endpoint, there is a chance for unrelated aliases to get deleted on the endpoint.

For example, let's say

  1. I create a node on the content server with path alias "foo", and the path entry gets assigned pid 1234.
  2. Simultaneously, someone creates a path alias "bar" on the endpoint that gets assigned pid 1234 in its respective database.
  3. When I deploy the node with path alias "foo" (pid 1234) from the content server to the endpoint...
  4. On the endpoint, path_save() first looks up and deletes the existing path entry by pid (common/path.inc:438)
  5. This deleted pid actually pointed to the completely unrelated alias entry "bar". The path alias "bar" has now been deleted on the endpoint: Whoops!
  6. path_save() then creates a new entry for "foo" on the endpoint.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hawkeye.twolf’s picture

Patch attached. Note that this approach removes support for multiple aliases. As pointed out here, supporting multiple aliases is incorrect, and it's better to rely on the path module to load the alias.

hawkeye.twolf’s picture

Issue summary: View changes
hawkeye.twolf’s picture

Issue summary: View changes
hawkeye.twolf’s picture

Issue summary: View changes
hawkeye.twolf’s picture

Issue summary: View changes
hawkeye.twolf’s picture

Improved patch attached. It keeps the aliases from being continually deleted/recreated on deployment (currently uuid_path deletes/recreates existing aliases multiple times per deployment even when they already match).