Skip to content
Snippets Groups Projects

conditional_fields-3494204/3494204-call-to-deprecated: Replace deprecated...

2 files
+ 14
12
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -18,6 +18,7 @@ use Drupal\conditional_fields\Conditions;
use Drupal\conditional_fields\DependencyHelper;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Psr\Log\LoggerInterface;
/**
* An edit form for conditional fields.
@@ -38,8 +39,10 @@ class ConditionalFieldEditForm extends FormBase {
protected EntityTypeManagerInterface $entityTypeManager,
protected FormBuilderInterface $formBuilder,
protected ModuleHandlerInterface $moduleHandler,
protected LoggerChannelInterface $logger,
) {}
protected LoggerInterface $logger,
) {
$this->logger = $logger;
}
/**
* {@inheritdoc}
@@ -557,16 +560,7 @@ class ConditionalFieldEditForm extends FormBase {
$form_object->setEntity($dummy_entity);
}
catch (InvalidPluginDefinitionException $e) {
// @todo Backwards compatibility of error logging. See
// https://www.drupal.org/node/2932520. This can be removed when we no
// longer support Drupal < 10.2.
if (version_compare(\Drupal::VERSION, '10.1', '>=')) {
Error::logException($this->logger, $e);
}
else {
// @phpstan-ignore-next-line
watchdog_exception('conditional_fields', $e);
}
Error::logException($this->logger, $e);
// @todo May be it make sense to return markup?
return NULL;
}
Loading