Skip to content
Snippets Groups Projects
Commit eb2f3152 authored by William Dickson's avatar William Dickson Committed by Alexander Hass
Browse files

Issue #3062567 by wrd, hass: Config page throws error if database

logging is not enabled
parent 03ebe86d
No related branches found
No related tags found
No related merge requests found
......@@ -352,12 +352,6 @@ class LinkCheckerAdminSettingsForm extends ConfigFormBase {
];
$form['error']['linkchecker_action_status_code_301'] = [
'#title' => $this->t('Update permanently moved links'),
'#description' => $this->t('If enabled, outdated links in content providing a status <em>Moved Permanently</em> (status code 301) are automatically updated to the most recent URL. If used, it is recommended to use a value of <em>three</em> to make sure this is not only a temporarily change. This feature trust sites to provide a valid permanent redirect. A new content revision is automatically created on link updates if <em>create new revision</em> is enabled in the <a href=":content_types">content types</a> publishing options. It is recommended to create new revisions for all link checker enabled content types. Link updates are nevertheless always logged in <a href=":dblog">recent log entries</a>.', [
':dblog' => Url::fromRoute('dblog.overview')
->toString(),
':content_types' => Url::fromRoute('entity.node_type.collection')
->toString(),
]),
'#type' => 'select',
'#default_value' => $config->get('error.action_status_code_301'),
'#options' => [
......@@ -369,6 +363,12 @@ class LinkCheckerAdminSettingsForm extends ConfigFormBase {
10 => $this->t('After ten failed checks'),
],
];
if (\Drupal::moduleHandler()->moduleExists('dblog') && \Drupal::currentUser()->hasPermission('access site reports')) {
$form['error']['#description'] = $this->t('If enabled, outdated links in content providing a status <em>Moved Permanently</em> (status code 301) are automatically updated to the most recent URL. If used, it is recommended to use a value of <em>three</em> to make sure this is not only a temporarily change. This feature trust sites to provide a valid permanent redirect. A new content revision is automatically created on link updates if <em>create new revision</em> is enabled in the <a href=":content_types">content types</a> publishing options. It is recommended to create new revisions for all link checker enabled content types. Link updates are nevertheless always logged in <a href=":dblog">recent log entries</a>.', [':dblog' => \Drupal::url('dblog.overview'), ':content_types' => \Drupal::url('entity.node_type.collection')]);
}
else {
$form['error']['#description'] = $this->t('If enabled, outdated links in content providing a status <em>Moved Permanently</em> (status code 301) are automatically updated to the most recent URL. If used, it is recommended to use a value of <em>three</em> to make sure this is not only a temporarily change. This feature trust sites to provide a valid permanent redirect. A new content revision is automatically created on link updates if <em>create new revision</em> is enabled in the <a href=":content_types">content types</a> publishing options. It is recommended to create new revisions for all link checker enabled content types. Link updates are nevertheless always logged.', [':content_types' => \Drupal::url('entity.node_type.collection')]);
}
$form['error']['linkchecker_action_status_code_404'] = [
'#title' => $this->t('Unpublish content on file not found error'),
'#description' => $this->t('If enabled, content with one or more broken links (status code 404) will be unpublished and moved to moderation queue for review after the number of specified checks failed. If used, it is recommended to use a value of <em>three</em> to make sure this is not only a temporarily error.'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment