Because of a change in core, tests will now throw exceptions if any deprecated APIs are used. This change is in core for 8.5.x so we have some time to update Metatag accordingly.

An example test run is https://www.drupal.org/pift-ci-job/818280 where it threw this error quite a lot:

exception: [User deprecated function] Line 308 of core/lib/Drupal/Core/Field/BaseFieldDefinition.php:
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.

Comments

DamienMcKenna created an issue. See original summary.

acbramley’s picture

Title: Replace all deprecated code » Replace deprecated BaseFieldDefinition ::setQueryable
Status: Active » Needs review
StatusFileSize
new496 bytes

We should be able to just remove it since we're already setting the field as computed.

vakulrai’s picture

StatusFileSize
new561 bytes

Adding a patch which will replace deprecated method .

acbramley’s picture

@vakulrai that's incorrect, a computed field must have custom storage. You can see this by the doc block on setCustomStorage:

   * @throws \LogicException
   *   Thrown if custom storage is to be set to FALSE for a computed field.
   */
  public function setCustomStorage($custom_storage) {
nkoporec’s picture

Tested #2 and it works as expected.

damienmckenna’s picture

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Agreed, #2 looks good and is enough.

damienmckenna’s picture

Thanks for the review, @Berdir.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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

damienmckenna’s picture