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.
Tome only supports path/prefix based language negotiation right now, and hasn't really figured out how domain based negotiation would look - either from the hosting side or the static generation side. We should come up with a plan and support it.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2996234-8.patch | 7.61 KB | samuel.mortenson |
| |||
#8 | interdiff-2996234-7-8.txt | 2.86 KB | samuel.mortenson |
Comments
Comment #2
samuel.mortensonI think we could probably do this all in the Drush commands, just get all the configured domains and hit every static path with every domain. Would be pretty slow but that's the only way to guarantee that absolute paths are correct for every export.
Comment #3
Wim Leers#2++
Comment #4
samuel.mortensonComment #5
samuel.mortensonCopying from #3022653: Multilingual site with domain negotation:
Comment #6
samuel.mortensonHere's a fix for the "http:// in the path" bug mentioned in #5. Apparently Url objects can be assembled as absolute even when you explicitly set the absolute option to FALSE - reading through core a bit showed me that the absolute flag is only for making relative paths absolute. Because of this, when using domain based language negotiation, some paths collected early in Tome's process included absolute paths.
For the canonical redirect issue, I'm not sure I understand the problem. @Berdir, if you're following this issue, care to comment?
Comment #7
samuel.mortensonThere's a performance problem here as well - with the last patch every translation of every entity will be processed for each domain. At first I thought that a good solution would be to only process entity translations for the current domain's language if domain negotiation is used, but that might be too aggressive.
For example, if you have one translation of an entity with no path, it is available on all domains at its canonical path (i.e. /node/1). If you have one translation with a path, that path 404s on other domains.
Here's a rough patch that excludes paths for other domains, but doesn't solve the edge case yet.
Comment #8
samuel.mortensonAdded test coverage. I think it's OK if we just document this behavior and don't support the edge case from #7.
Comment #10
samuel.mortensonLet's get this in as-is - it's better than no support at all and the edge case has an easy workaround (set an alias).