updated core from 8.4 to 8.5 : bug with login_destination

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-13 14:01:21 +01:00
parent 0d78da249b
commit e668535a4e
3486 changed files with 89604 additions and 33283 deletions
@@ -2,6 +2,7 @@ id: d6_syslog_settings
label: System log configuration
migration_tags:
- Drupal 6
- Configuration
source:
plugin: variable
variables:
@@ -2,6 +2,7 @@ id: d7_syslog_settings
label: Syslog configuration
migration_tags:
- Drupal 7
- Configuration
source:
plugin: variable
variables:
@@ -77,6 +77,7 @@ class SysLog implements LoggerInterface {
'!ip' => $context['ip'],
'!request_uri' => $context['request_uri'],
'!referer' => $context['referer'],
'!severity' => $level,
'!uid' => $context['uid'],
'!link' => strip_tags($context['link']),
'!message' => strip_tags($message),
+3 -3
View File
@@ -6,8 +6,8 @@ package: Core
# core: 8.x
configure: system.logging_settings
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
+1 -1
View File
@@ -54,7 +54,7 @@ function syslog_form_system_logging_settings_alter(&$form, FormStateInterface $f
'#type' => 'textarea',
'#title' => t('Syslog format'),
'#default_value' => $config->get('format'),
'#description' => t('Specify the format of the syslog entry. Available variables are: <dl><dt><code>!base_url</code></dt><dd>Base URL of the site.</dd><dt><code>!timestamp</code></dt><dd>Unix timestamp of the log entry.</dd><dt><code>!type</code></dt><dd>The category to which this message belongs.</dd><dt><code>!ip</code></dt><dd>IP address of the user triggering the message.</dd><dt><code>!request_uri</code></dt><dd>The requested URI.</dd><dt><code>!referer</code></dt><dd>HTTP Referer if available.</dd><dt><code>!uid</code></dt><dd>User ID.</dd><dt><code>!link</code></dt><dd>A link to associate with the message.</dd><dt><code>!message</code></dt><dd>The message to store in the log.</dd></dl>'),
'#description' => t('Specify the format of the syslog entry. Available variables are: <dl><dt><code>!base_url</code></dt><dd>Base URL of the site.</dd><dt><code>!timestamp</code></dt><dd>Unix timestamp of the log entry.</dd><dt><code>!type</code></dt><dd>The category to which this message belongs.</dd><dt><code>!ip</code></dt><dd>IP address of the user triggering the message.</dd><dt><code>!request_uri</code></dt><dd>The requested URI.</dd><dt><code>!referer</code></dt><dd>HTTP Referer if available.</dd><dt><code>!severity</code></dt><dd>The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).</dd><dt><code>!uid</code></dt><dd>User ID.</dd><dt><code>!link</code></dt><dd>A link to associate with the message.</dd><dt><code>!message</code></dt><dd>The message to store in the log.</dd></dl>'),
];
$form['#submit'][] = 'syslog_logging_settings_submit';
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- syslog
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
@@ -4,7 +4,6 @@ namespace Drupal\Tests\syslog\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Test syslog logger functionality.
@@ -54,4 +53,26 @@ class SyslogTest extends KernelTestBase {
$this->assertEquals('My warning message.', $log[8]);
}
/**
* Test severity level logging.
*
* @covers ::log
*/
public function testSyslogSeverity() {
/* @var \Drupal\Core\Config\Config $config */
$config = $this->container->get('config.factory')->getEditable('syslog.settings');
$config->set('format', '!type|!message|!severity');
$config->save();
\Drupal::logger('my_module')->warning('My warning message.');
$log_filename = $this->container->get('file_system')->realpath('public://syslog.log');
$logs = explode(PHP_EOL, file_get_contents($log_filename));
$log = explode('|', $logs[0]);
$this->assertEquals('my_module', $log[0]);
$this->assertEquals('My warning message.', $log[1]);
$this->assertEquals('4', $log[2]);
}
}