Needs work
Project:
Pathauto
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Oct 2020 at 09:56 UTC
Updated:
29 Jul 2024 at 14:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
huzookaComment #3
wim leersComment #4
huzookaComment #5
huzookaFixed the new coding standard violations.
I'll post a self-review soon.
Comment #6
huzookaComment #7
huzookaComment #8
huzookaToken module should also be enabled.
Comment #9
huzookaThis patch re-uses the logic from the taxonomy term migrations so the forum pattern migration will use the source's forum nav's vocabulary machine name in it derivative ID.
Comment #10
wim leersassertNodePattern(), not on the forum pathauto pattern migration. Why is that? 🤔🤔 So … this is all basically wrong/overly simplistic in HEAD? 🤯
🤔 … and this was missing?! 🙈
🤩👏 Absolutely superb comments for this very tricky thing.
🤔 But I wonder … why is this in a sample hook implementation? Why is this not applied automatically, at least the forum node example?
👍 Looks great!
👍 Looks great!
🤓 I think s/sources// would be clearer.
🤔 Referring back to my point 4 — why is this in here but not that other example?
Also, this could use an
@seeto that hook 🤓🤔 So … this pattern would exist even if the forum module was not enabled on the source site?
👍 Nice heuristic!
👍
🤔 I presume that the D7
pathautomodule already functioned this way, and in D8 it's just more explicit?Comment #11
huzookaRe #10:
#10 is the review of #8, and not #9.
Well, these processes are replacing a part of the logic of the original
::prepareRowmethod.entity_typeandbundle, decouplingentity_typeandbundleparams from the original::prepareRowmethod is crucial.Comment #12
huzookaI just noticed that when the current taxonomy vocabulary is the one used by forum navigation, then the "original" taxonomy vocabulary pattern is skipped: see https://git.drupalcode.org/project/pathauto/-/blob/7.x-1.x/pathauto.modu...
Comment #13
huzookaAddressing #12.
Comment #14
huzookaThis patch makes
PathautoPattern::count()return the actual number of rows to migrate.Comment #15
wim leers🤓This did not address #10.7 — I asked "sources" to be removed.
#14: I don't understand this —
PathautoPattern::count()inherited\Drupal\migrate\Plugin\migrate\source\SourcePluginBase::count(), which calls\Drupal\migrate\Plugin\migrate\source\SourcePluginBase::doCount(), which doesComment #16
wim leersOops! This is wrong! @huzooka pointed out that
PathautoPattern::count()will result in a call to\Drupal\migrate\Plugin\migrate\source\SqlBase::doCount(), which does do what Zoltan's comment in #14 described.So … that means the only remark I have left is that silly nitpick in #15.1. Obviously that's non-essential.
So … 🚢🥳
Comment #17
berdirThanks for all the work on pathauto migrate stuff and the extensive reviews.
In theory, there still is forum specific integration for forum aliases but it's broken, also because core has been broken since forever, so I'm not completely sure about this. If we do this and decide that forum specific integration is no longer necessary/useful, shouldn't we also remove that? There are quite a few issues and it's causing confusion.
Comment #18
huzooka@Berdir, this is about the pattern migration.
If core has issues with the forum alias migrations, I think that also that bug should be fixed (https://www.w3.org/Provider/Style/URI)
Comment #19
berdirI know it is a about the pattern migration. My point is that \Drupal\pathauto\Plugin\pathauto\AliasType\ForumAliasType *does* exist, but it doesn't work because core's forum prefix is broken. It's *supposed* to be forum/ID, not taxonomy/term/ID but has never worked in D8. See #2010132: Canonical taxonomy term link for forum vocabulary is broken. And as a result, our plugin is also broken (likely not just because of that core issue).
As a result, it is challenging to review/test/accept changes in this very broken context and I'm not quite sure I understand what this issue is doing exactly and what the overall intent is.
Comment #20
huzookaRe #19:
Although that plugin is broken, the (forum taxonomy) pattern we migrate into here works well. Long story short: the pattern which is used for the forum taxonomy vocabulary should be the destination pattern of the D7 forum vocabulary, and that's what I solve here.
Comment #21
wim leers#20++
Comment #22
narendrarPatch rerolled for failing test on 9.3.0
Comment #23
huzooka#22 ignores checking dependencies metadata 👍. These kind of metadata isn't migrated – these are calculated by the config entity class. (This is necessary because the latest pathauto release does not depend on ctools.)
Comment #24
damienmckennaRerolled.
Comment #25
damienmckennaRerolled to adjust for some fuzz.
Comment #26
damienmckennaMight one of the maintainers be willing to review this and provide feedback, especially around requirements for getting this committed? Thank you.
Comment #27
dan612 commentedPatch is failing to apply for me on Drupal 10.2.3 + 8.x-1.12 -- attempt at rerolling ... but something not quite right. This patch was made against 8.x-1.12, which explains why it is failing on 8.x-1.x. Things have changed.
Comment #28
wim leers#27: Right — we only need
MigratePathautoTestto pass on1.12for this to be incorporated into #3424401: D10: Update recommendation for Pathauto (drupal/pathauto).(There seems to be little point in making this work against
8.x-1.xbecause it's been green multiple times over the past few years and the maintainer hasn't committed it.)We can't ask DrupalCI or GitLab CI to test against a specific tag very easily, so just sharing the output of running the test suite locally will suffice 👍
Comment #29
berdir> (There seems to be little point in making this work against 8.x-1.x because it's been green multiple times over the past few years and the maintainer hasn't committed it.)
The issue wasn't RTBC for 2 years.
I'm still confused about the focus on this, soon enough forum won't even be in core anymore. It's literally a 1000 lines of code (that I'll have to maintain and keep working forever) to migrate what's essentially a single pattern for the few sites that are using forum module that will usually take a few minutes to set up again. A lot of that is tests but still. I've spent quite some time on fixing Migrate tests in various modules already for D9/D10 compatibility and it's one thing if there's data involved that would actually be a lot of work, but for something like pathauto, I'm struggling to see the benefit.
I've personally never did a ull 1:1 migration of a D7 project. If people see a benefit in maintaining migrations for this, then it might be better suited in a separate project?
this is outdated and doesn't work anymore on D10. node_type no longer exists.
Comment #30
wim leersOh yes, sorry — it was not meant in a negative way at all. I think it's fine that it's up to us to keep maintaining this 👍😊
(This is meant for those people for whom writing the code/YAML files to use the Drupal core migration system is unrealistic.)
I'd like for this to remain an open issue here for now to increase the odds of such non-expert users discovering it.
P.S.: the value of this issue alone seems limited for sure, but it's a blocker for #3179865: [PP-1] Derive pathauto pattern migrations to solve inaccurate pattern migration dependencies, and that is what brings the real value!
Comment #31
dan612 commentedAttaching reroll with updates to tests to avoid the following errors:
Comment #32
jienckebd commentedHey Dan!! I know you.
The 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 #33
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.