Skip to content
Snippets Groups Projects

Convert warning to RuntimeException.

2 files
+ 21
15
Compare changes
  • Side-by-side
  • Inline

Files

@@ -9,6 +9,7 @@
@@ -9,6 +9,7 @@
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\FormStateInterface;
 
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\Core\TypedData\DataDefinition;
@@ -52,6 +53,8 @@
@@ -52,6 +53,8 @@
*/
*/
class ImageItem extends FileItem {
class ImageItem extends FileItem {
 
use LoggerChannelTrait;
 
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
@@ -332,7 +335,7 @@ public function preSave() {
@@ -332,7 +335,7 @@ public function preSave() {
}
}
}
}
else {
else {
trigger_error(sprintf("Missing file with ID %s.", $this->target_id), E_USER_WARNING);
$this->getLogger('image')->warning("Missing file with ID %id.", ['%id' => $this->target_id]);
}
}
}
}
Loading