Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294311

datetime_range throwing error in datetime_range_entity_view_display_presave()

$
0
0

Problem/Motivation

Encountering following error: Warning: Trying to access array offset on value of type null in datetime_range_entity_view_display_presave() (line 57 of core/modules/datetime_range/datetime_range.module).
This seems to happen because we use extra fields via (extra_field_plus / Frontend Editing)

Extra fields don't seem to provide a field formatter - but the datetime_range code assumes that there's always one:

if (!in_array($plugin_definition['class'], $daterange_formatter_classes, FALSE)) {

According to \Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition() it is valid to return NULL, especially if $exception_on_invalid is set to FALSE - which our code does.

For 11.x this is obsolete due: 3442162

Steps to reproduce

Proposed resolution

Add a check for $plugin_definition['class'].

Remaining tasks

  1. ✓ Writing code
  2. Reviews
  3. Merge

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet


Viewing all articles
Browse latest Browse all 294311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>