Problem/Motivation
Currently, Pathauto module does not migrate Drupal 7 Pathauto's language-specific patterns.
Proposed resolution
Migrate language-specific patterns as well.
Currently, Pathauto module does not migrate Drupal 7 Pathauto's language-specific patterns.
Migrate language-specific patterns as well.
Comments
Comment #2
huzookaPatches depend on #3179865: [PP-1] Derive pathauto pattern migrations to solve inaccurate pattern migration dependencies and the complete patch conflicts with #3079275: Custom aliases (which are not generated with the actual patterns) can be lost during the migration.
Comment #3
wim leersThis generates a context mapping of
but when
\Drupal\Core\Plugin\Context\ContextHandler::applyContextMapping()runs this code:the first

catchcatches the exception:and … silences it 😨 (This silencing was introduced by #3029625: Do not throw an exception when a context is missing while applying context mapping to a plugin if that context was previously set + #3046243: Regression: Optional context values may throw exceptions if unsatisfied.)
But then eventually in that same
\Drupal\Core\Plugin\Context\ContextHandler::applyContextMapping(), a differentContextExceptionis generated:The problem here is that the much more specific and hence helpful
throw new ContextException(sprintf("The %s context is not a valid context.", $name));exception is never actually shown; the only way to get at it is by stepping through the code with a debugger.Comment #4
wim leersAn exact Google search only finds to matches: https://www.google.com/search?hl=en&ei=OrpIYLzgLJG9sAeytI3QDA&q=%22node%... — those are #1669876: Add missing language functionality in search module and #2660236: Wrong export of context_definitions resulting in Fatal error node form.
The first search result is completely irrelevant — no clue why Google lists this as an exact match 🤷♂️
The second … is highly relevant.
Comment #5
wim leersPaired with @huzooka and we figured out the root cause by exporting all config, resaving the pathauto patterns from the config UI and then re-exporting:
Obviously the absence of config entity validation is a huge risk during migrations … 😬
So we'll need to update
… to also specify the
relationshipskey.Comment #6
wim leersComment #7
huzookaComment #8
huzookaThis patch should address the issues raised in the previous comments:
formto a process plugin :sad-panda-face: )..Comment #9
wim leersManually tested: works great! 👏🤩
Comment #10
huzookaSlightly updated test module... fix-only patch is the same as in #8.
Comment #11
huzookaRebased on top of #3179835-14: Migrate forum pattern to taxonomy term forums if forum is enabled on the source site and #3179865-25: [PP-1] Derive pathauto pattern migrations to solve inaccurate pattern migration dependencies.
Comment #12
narendrarRebased on top of #3179835-22: Migrate forum pattern to taxonomy term forums if forum is enabled on the source site and #3179865-25: [PP-1] Derive pathauto pattern migrations to solve inaccurate pattern migration dependencies.
Comment #13
huzooka#12 ignores checking dependencies metadata calculated by the config entity class 👍.
Comment #14
jienckebd commentedThe node_type condition plugin was deprecated since Drupal 9.3 in favor of a generalized entity_bundle:* condition plugin.
This pathauto issue applies this change to 1.x branch.
The patch in this issue still references the removed node_type condition plugin and results in test failures.
The attached patch replaces references to the node_type condition plugin with references to the generalized entity_bundle:node condition plugin.
Comment #15
jienckebd commentedIt seems that this issue combines 4 pathauto 1.x issues including this one. So I applied the same change to that issue to make the combined patch pass tests.