Migrate forum pattern to taxonomy term forums if forum is enabled on the source site

Created on 30 October 2020, about 4 years ago
Updated 29 July 2024, 4 months ago

Problem/Motivation

Right now, Pathauto pattern migration skips migrating the pattern stored in the pathauto_forum_pattern variable. But if forum was enabled on the source site, then this pattern can be migrated as a pattern for taxonomy_term with bundle forums (see d7_taxonomy_vocabulary.yml).

Proposed resolution

Refactor the PathautoPattern migration source plugin to migrate this pattern as a taxonomy_term forums pattern.

It would be nice if these patterns can be mapped to a different entity type (and bundle).

Remaining tasks

* patch
* test

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary huzooka Hungary πŸ‡­πŸ‡ΊπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    50 pass
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Rerolled to adjust for some fuzz.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Might one of the maintainers be willing to review this and provide feedback, especially around requirements for getting this committed? Thank you.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    Patch is failing to apply for me on Drupal 10.2.3 + 8.x-1.12 -- rerolling

  • Status changed to Needs work 9 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    #27: Right β€” we only need MigratePathautoTest to pass on 1.12 for this to be incorporated into πŸ“Œ D10: Update recommendation for Pathauto (drupal/pathauto) Needs work .

    (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.)

    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 πŸ‘

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    > (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?

    +++ b/src/Plugin/migrate/process/PathautoPatternSelectionCriteria.php
    @@ -0,0 +1,51 @@
    +    return [
    +      [
    +        'id' => ($entity_type == 'node') ? 'node_type' : 'entity_bundle:' . $entity_type,
    +        'bundles' => [$bundle => $bundle],
    

    this is outdated and doesn't work anymore on D10. node_type no longer exists.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Oh 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.)

  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    Attaching reroll with updates to tests to avoid the following errors:

    PHP Fatal error:  Declaration of Drupal\Tests\pathauto\Kernel\Migrate\d7\MigratePathautoTest::setUp() must be compatible with Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase::setUp(): void in /app/docroot/modules/contrib/pathauto/tests/src/Kernel/Migrate/d7/MigratePathautoTest.php on line 91
    
    Drupal\Tests\pathauto\Kernel\Migrate\d7\MigratePathautoTest::testPathautoMigrations with data set "Disabled forum on source site" (false)
    Error: Call to undefined function Drupal\Tests\pathauto\Kernel\Migrate\d7\drupal_get_path()
    
  • πŸ‡ΊπŸ‡ΈUnited States jienckebd

    Hey 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.

  • πŸ‡ΊπŸ‡ΈUnited States jienckebd

    It seems that this issue πŸ› Custom aliases (which are not generated with the actual patterns) can be lost during the migration Needs review 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.

  • First commit to issue fork.
  • Pipeline finished with Success
    4 months ago
    Total: 182s
    #237437
Production build 0.71.5 2024