Problem/Motivation

Discovered in #3042715: Drupal 9 Deprecated Code Report.

1) Drupal\Tests\votingapi_tokens\Kernel\VoteTokenTest::testVoteTokens
Drupal\Core\Entity\EntityStorageException: The "path_alias" entity type does not exist.

Proposed resolution

Removing the path_alias integration. The votingapi_tokens submodule does not need to test path aliases.

-    if (\Drupal::entityTypeManager()->hasDefinition('path_alias')) {
-      $this->installEntitySchema('path_alias');
-    }
     \Drupal::service('router.builder')->rebuild();
     $this->installConfig(['system']);
 
@@ -71,7 +68,6 @@ class VoteTokenTest extends KernelTestBase {
       'type' => 'page',
       'title' => 'Source Title',
       'revision_log' => $this->randomMachineName(),
-      'path' => ['alias' => '/content/source-node'],
     ]);

Comments

Krzysztof Domański created an issue. See original summary.

krzysztof domański’s picture

Status: Active » Needs review
StatusFileSize
new2.17 KB
new904 bytes

1. Test only has the deprecated code removed. You can see the problem more easily.
2. The test on D9 (3143178-2.patch) failed due to deprecated code #3042715: Drupal 9 Deprecated Code Report.

andralex’s picture

Status: Needs review » Reviewed & tested by the community

Tested locally on D9 with both patches applied. All the tests are passed now.

tr’s picture

  protected static $modules = [
    'path',
    'token',
    'system',
    'user',
    'node',
    'field',
    'field',
    'filter',
    'text',
    'votingapi',
    'votingapi_tokens',
  ];

Probably don't need 'path' here either. And certainly don't need 'field' twice ... What about 'filter' and 'text'? Might as well clean this up while path is being removed.

krzysztof domański’s picture

@TR Good point! Let's clearing that separately after removing deprecated code. It will be easier to test. Now we need to merge several patches to test Drupal 9. See #3. I created follow-up #3143358: Remove unnecessary test modules from VoteTokenTest.

tr’s picture

Status: Reviewed & tested by the community » Postponed

Now we need to merge several patches to test Drupal 9

Yeah, that's why I opened #3138493: Plan for Drupal 9 - the deprecations should have been handled first, exactly for this reason. I've been trying to make that happen for four weeks now ... we didn't even have testing turned on back then, and didn't have any working tests, so we've come a long way in those four weeks but the deprecations are still blocking other work like this.

We need the deprecation issue committed, THEN we need to turn on automated testing for D9, THEN we can start addressing any test failures in D9.

tr’s picture

Status: Postponed » Reviewed & tested by the community

Deprecations have been committed and testing has been turned on for D9

I retested the patch 3143178-2.patch in #2 and as you can see Voting API now passes all tests in D9!

RTBC.

pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.