Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
- I create a node on the content server with path alias "foo", and the path entry gets assigned pid 1234.
- Simultaneously, someone creates a path alias "bar" on the endpoint that gets assigned pid 1234 in its respective database.
- When I deploy the node with path alias "foo" (pid 1234) from the content server to the endpoint...
- On the endpoint, path_save() first looks up and deletes the existing path entry by pid (common/path.inc:438)
- This deleted pid actually pointed to the completely unrelated alias entry "bar". The path alias "bar" has now been deleted on the endpoint: Whoops!
- path_save() then creates a new entry for "foo" on the endpoint.
Comment | File | Size | Author |
---|---|---|---|
#6 | deployment_of_path-2451407-6.patch | 1.94 KB | hawkeye.twolf |
#1 | deployment_of_path-2451407-1.patch | 1.52 KB | hawkeye.twolf |
Comments
Comment #1
hawkeye.twolfPatch 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.
Comment #2
hawkeye.twolfComment #3
hawkeye.twolfComment #4
hawkeye.twolfComment #5
hawkeye.twolfComment #6
hawkeye.twolfImproved 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).