Problem/Motivation

Since #2870194: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code, the following tests fail:

  1. FileDownloadUrlTest
  2. JsonApiDocumentTopLevelNormalizerTest
  3. EntityToJsonApiTest

For example, for the latter:

Remaining deprecation notices (6)

BaseFieldDefinition::setQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage(). See https://www.drupal.org/node/2856563: 5x
    5x in EntityToJsonApiTest::testSerialize from Drupal\Tests\jsonapi\Kernel

That change was introduced by #2855886: Deprecate \Drupal\Core\Field\FieldStorageDefinitionInterface::isQueryable() because it's not used anywhere.

Proposed resolution

Change setQueryable(FALSE) to setCustomStorage(TRUE).

Note that setCustomStorage() is not newly introduced in 8.4.x, so ceasing to use the deprecated code will still allow JSON API to work with Drupal 8.3.

Test against 8.3 + 8.4 + 8.5.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Wim Leers’s picture

Issue summary: View changes
Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

The failures in 8.5 no longer contain the setQueryable() failing deprecation.

HEAD
Testing Drupal\Tests\jsonapi\Kernel\Field\FileDownloadUrlTest
.

Time: 762 ms, Memory: 4.00MB

OK (1 test, 11 assertions)

Remaining deprecation notices (2)

\Drupal\Core\Routing\Enhancer\RouteEnhancerInterface is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Routing\EnhancerInterface. See https://www.drupal.org/node/2894934: 1x
    1x in FileDownloadUrlTest::testUrlField from Drupal\Tests\jsonapi\Kernel\Field

BaseFieldDefinition::setQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage(). See https://www.drupal.org/node/2856563: 1x
    1x in FileDownloadUrlTest::testUrlField from Drupal\Tests\jsonapi\Kernel\Field
Patch
Testing Drupal\Tests\jsonapi\Kernel\Field\FileDownloadUrlTest
.

Time: 753 ms, Memory: 4.00MB

OK (1 test, 11 assertions)

Remaining deprecation notices (1)

\Drupal\Core\Routing\Enhancer\RouteEnhancerInterface is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Routing\EnhancerInterface. See https://www.drupal.org/node/2894934: 1x
    1x in FileDownloadUrlTest::testUrlField from Drupal\Tests\jsonapi\Kernel\Field

  • Wim Leers committed f492c90 on 8.x-1.x
    Issue #2926409 by Wim Leers: BaseFieldDefinition::setQueryable() is...
Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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