Errors due to deprecated features in core

Created on 24 July 2023, over 1 year ago
Updated 14 February 2024, 9 months ago

Problem/Motivation

My drupal-installation has started to report error for some of my content, in fact three errors are thrown.

An extract of the error log are shown below

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\Core\Url::fromUri() (line 281 of core/lib/Drupal/Core/Url.php).
Drupal\Core\Url::fromUri(NULL) (Line: 32)
Drupal\feeds\Plugin\Field\FieldType\FeedsItem->getUrl() (Line: 95)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->buildUrl(Object) (Line: 73)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->viewElements(Object, 'nb') (Line: 89)
Drupal\Core\Field\FormatterBase->view(Object, 'nb') (Line: 76)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL) (Line: 265)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 266)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 223)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 461)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Drupal\Core\Field\FieldItemList->view(Array) (Line: 171)
Drupal\ctools_block\Plugin\Block\EntityField->blockAccess(Object) (Line: 127)
Drupal\Core\Block\BlockBase->access(Object, 1) (Line: 124)
Deprecated function: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in Drupal\Core\Url::fromUri() (line 284 of core/lib/Drupal/Core/Url.php).
Drupal\Core\Url::fromUri(NULL) (Line: 32)
Drupal\feeds\Plugin\Field\FieldType\FeedsItem->getUrl() (Line: 95)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->buildUrl(Object) (Line: 73)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->viewElements(Object, 'nb') (Line: 89)
Drupal\Core\Field\FormatterBase->view(Object, 'nb') (Line: 76)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL) (Line: 265)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 266)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 223)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 461)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Drupal\Core\Field\FieldItemList->view(Array) (Line: 171)
Drupal\ctools_block\Plugin\Block\EntityField->blockAccess(Object) (Line: 127)
Drupal\Core\Block\BlockBase->access(Object, 1) (Line: 124)
Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\Core\Url::fromUri() (line 289 of core/lib/Drupal/Core/Url.php).
Drupal\Core\Url::fromUri(NULL) (Line: 32)
Drupal\feeds\Plugin\Field\FieldType\FeedsItem->getUrl() (Line: 95)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->buildUrl(Object) (Line: 73)
Drupal\feeds\Plugin\Field\FieldFormatter\FeedsItemUrlFormatter->viewElements(Object, 'nb') (Line: 89)
Drupal\Core\Field\FormatterBase->view(Object, 'nb') (Line: 76)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL) (Line: 265)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 266)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 223)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 461)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Drupal\Core\Field\FieldItemList->view(Array) (Line: 171)
Drupal\ctools_block\Plugin\Block\EntityField->blockAccess(Object) (Line: 127)
Drupal\Core\Block\BlockBase->access(Object, 1) (Line: 124)

Steps to reproduce

When I looked into it, it is only imported items that causes problems. (It is an import of a structured text-file, manually initiated import) The reason probably being that the url-part of the feeds_item-field is null? See below. I may as well create content manually, those do not have this problem (as the entire field then is empty)

feeds_item => array (1)
    x-default => array (1)
       0 => array (5)
          target_id => string (2) "33"
          imported => string (10) "1623530674"
             2021-06-12 20:44:34 UTC
          url => null
          guid => string (0) ""
          hash => string (32) "525e35ea6b07109149ad2ebb490a8a2d"

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Component

Code

Created by

🇳🇴Norway oasweb Oslo

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

Comments & Activities

Production build 0.71.5 2024