From 7b301664f930e3e8fcb7068ee6132ee2644f8b66 Mon Sep 17 00:00:00 2001 From: tduong992 Date: Tue, 5 Apr 2016 17:43:12 +0200 Subject: [PATCH 1/2] added log_404 enabled check and updated default_value in settings form --- src/Form/RedirectFix404Form.php | 2 +- src/Form/RedirectSettingsForm.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Form/RedirectFix404Form.php b/src/Form/RedirectFix404Form.php index 8350380..50b3c4e 100644 --- a/src/Form/RedirectFix404Form.php +++ b/src/Form/RedirectFix404Form.php @@ -124,7 +124,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#theme' => 'table', '#header' => $header, '#rows' => $rows, - '#empty' =>$this->t('No 404 pages without redirects found.'), + '#empty' => $this->config('redirect.settings')->get('log_404') ? $this->t('No 404 pages without redirects found.') : $this->t('404 requests are currently not logged, enable it in the Settings.'), ); $form['redirect_404_pager'] = array('#type' => 'pager'); return $form; diff --git a/src/Form/RedirectSettingsForm.php b/src/Form/RedirectSettingsForm.php index a8e3dc9..98de004 100644 --- a/src/Form/RedirectSettingsForm.php +++ b/src/Form/RedirectSettingsForm.php @@ -55,10 +55,10 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#options' => redirect_status_code_options(), '#default_value' => $config->get('default_status_code'), ); - $form['redirect_error_log'] = array( + $form['redirect_404_log'] = array( '#type' => 'checkbox', '#title' => t('Log 404 errors.'), - '#default_value' => $config->get('error_log'), + '#default_value' => $config->get('log_404'), '#description' => t('In case you directly import 404 errors from the webserver, you need to disable logging to avoid duplicates.'), ); $form['globals'] = array( From aeacf23ceff2a276710084df371fe57c852787c3 Mon Sep 17 00:00:00 2001 From: tduong992 Date: Tue, 5 Apr 2016 17:46:17 +0200 Subject: [PATCH 2/2] updated log_404 setting description (UI) --- src/Form/RedirectSettingsForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/RedirectSettingsForm.php b/src/Form/RedirectSettingsForm.php index 98de004..549709e 100644 --- a/src/Form/RedirectSettingsForm.php +++ b/src/Form/RedirectSettingsForm.php @@ -59,7 +59,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'checkbox', '#title' => t('Log 404 errors.'), '#default_value' => $config->get('log_404'), - '#description' => t('In case you directly import 404 errors from the webserver, you need to disable logging to avoid duplicates.'), + '#description' => t('Logging 404 error allows to easily create redirects for often requested but missing pages.'), ); $form['globals'] = array( '#type' => 'fieldset',