Commit ce981eaf authored by Patrick Kannekens's avatar Patrick Kannekens
Browse files

Issue #2979557: Backend unresponsive

Fixed by removing attached libraries.
parent 13e60240
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\Component\Serialization\Json;

/**
 * Options form.
@@ -51,10 +52,6 @@ class OptionsForm extends FormBase {
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL): array {
    $form['#attached']['library'][] = 'easychart/easychart.admin';
    $form['#attached']['library'][] = 'easychart/lib.easycharts.full';
    $form['#attached']['library'][] = 'easychart/lib.highcharts';

    $default_options = '';
    if (file_exists('public://easychart-options.json')) {
      $default_options = file_get_contents('public://easychart-options.json');
@@ -119,7 +116,7 @@ class OptionsForm extends FormBase {
      }

      // Write to file.
      $this->fileSystem->saveData(json_encode($current_options), 'public://easychart-options.json', FileSystemInterface::EXISTS_REPLACE);
      $this->fileSystem->saveData(json_encode($current_options, JSON_PRETTY_PRINT), 'public://easychart-options.json', FileSystemInterface::EXISTS_REPLACE);
      $this->messenger()->addMessage($this->t('The configuration options have been saved.'));
    }
    else {