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

FieldTypePluginManager::getPluginClass() should throw an exception when called for a field type that doesn't exist

$
0
0

Problem/Motivation

\Drupal\Core\Field\FieldTypePluginManager::getPluginClass() calls getDefinition() with $exception_on_invalid = FALSE for.. historical reasons. It was initially introduced like that in #2293773: Field allowed values use dots in key names - not allowed in config probably because field widgets and formatters were also using $exception_on_invalid = FALSE, but the difference is that those two plugin types can fall back to a default widget/formatter, while a field type has no fallback.

Proposed resolution

Make \Drupal\Core\Field\FieldTypePluginManager::getPluginClass() throw the standard plugin not found exception.

This also fixes PHP 7.4 compatibility problems because the return statement of getPluginClass() will never be reached with an empty $plugin_definition variable.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.


Viewing all articles
Browse latest Browse all 296089

Trending Articles



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