Unverified Commit 15e3a121 authored by Alex Pott's avatar Alex Pott
Browse files

fix: #3463524 editor_post_update_sanitize_image_upload_settings fails on missing text format

By: sboden
By: catch
By: quietone
(cherry picked from commit 5e89bf91)
parent 9acca904
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -127,7 +127,14 @@ public function label() {
  public function calculateDependencies() {
    parent::calculateDependencies();
    // Create a dependency on the associated FilterFormat.
    $this->addDependency('config', $this->getFilterFormat()->getConfigDependencyName());
    $text_format = $this->getFilterFormat();
    if ($text_format) {
      $this->addDependency('config', $text_format->getConfigDependencyName());
    }
    else {
      trigger_error("The editor {$this->id()} is configured for text format {$this->id()} which does not exist. Review whether it is still needed and delete if not.", E_USER_WARNING);
    }

    // @todo use EntityWithPluginCollectionInterface so configuration between
    //   config entity and dependency on provider is managed automatically.
    $definition = $this->editorPluginManager()->createInstance($this->editor)->getPluginDefinition();