Commit f85af007 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3271092: Empty Watchdog text causing error 500 with WSOD

parent 9a60cebd
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
<?php

/**
 * @file
 */

use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Extension\ExtensionPathResolver;

@@ -37,3 +33,19 @@ function elogger_update_9101() {
  }
  $entity->save();
}

/**
 * Fix issue 3271092 for D9.
 */
function elogger_update_9102() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory->getEditable('elogger.settings');
  // Add defaults for new configuration values unless they were already set.
  if (empty($config->get('format'))) {
    $config->set('format', 'Elogger: [elogger:event_type] ON [elogger:module] BY [user:[elogger:user:name] (ID:user:[elogger:user:uid]) with Roles: [elogger:user:roles:join:,] - Message: [elogger:log_message]');
  }
  if (empty($config->get('elogger_row_limit'))) {
    $config->set('elogger_row_limit', '100000');
  }
  $config->save(TRUE);
}