Skip to content
Snippets Groups Projects
Commit f8c434e1 authored by Bram Goffings's avatar Bram Goffings Committed by Bram Goffings
Browse files

Issue #2669766 by aspilicious, Algeron, mr.baileys: Region Block gets cached too aggressively

parent 8a529ca4
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Url;
/**
* Implements hook_layout_alter().
......@@ -77,10 +78,14 @@ function ds_extras_form_entity_view_display_edit_form_alter(&$form, FormStateInt
$form['region_to_block'] = array(
'#type' => 'details',
'#group' => 'additional_settings',
'#title' => t('Block regions'),
'#title' => t('Block regions (deprecated)'),
'#description' => t('Create additional regions in this layout which will be exposed as blocks.')
);
$url = Url::fromUri('https://www.drupal.org/node/2754967');
$link = Drupal::l(t('handbook page'), $url);
$form['region_to_block']['deprecated'] = array(
'#markup' => '<b>' . t('This functionality is not compatible with some caching modules. Read the @handbook for a better alternative.', array('@handbook' => $link)) . '</b>'
);
$form['region_to_block']['new_block_region'] = array(
'#type' => 'textfield',
'#title' => t('Region name'),
......@@ -231,10 +236,12 @@ function ds_extras_form_ds_admin_form_alter(&$form, FormStateInterface $form_sta
);
if (\Drupal::moduleHandler()->moduleExists('block')) {
$url = Url::fromUri('https://www.drupal.org/node/2754967');
$link = Drupal::l(t('handbook page'), $url);
$form['fs3']['region_to_block'] = array(
'#type' => 'checkbox',
'#title' => t('Region to block'),
'#description' => t('Create additional regions exposed as block. Note: this will not work on the default view mode.'),
'#title' => t('Region to block (deprecated)'),
'#description' => t('Create additional regions exposed as block. Note: this will not work on the default view mode.') . '<br/>' . '<b>' . t('This functionality is not compatible with some caching modules. Read the @handbook for a better alternative.', array('@handbook' => $link)) . '</b>',
'#default_value' => $config->get('region_to_block'),
);
}
......
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