Update to Drupal 8.1.8. For more information, see https://www.drupal.org/project/drupal/releases/8.1.8
This commit is contained in:
parent
e9f047ccf8
commit
f9f23cdf38
312 changed files with 6751 additions and 1546 deletions
|
|
@ -25,7 +25,7 @@ interface AttachmentsResponseProcessorInterface {
|
|||
* $build['#attached']['library'][] = [
|
||||
* 'library' => ['core/jquery']
|
||||
* ];
|
||||
* $build['#attached']['http_header'][] = [
|
||||
* $build['#attached']['http_header'] = [
|
||||
* ['Content-Type', 'application/rss+xml; charset=utf-8'],
|
||||
* ];
|
||||
* @endcode
|
||||
|
|
|
|||
|
|
@ -636,8 +636,33 @@ class Renderer implements RendererInterface {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
foreach (array_keys($elements['#attached']['placeholders']) as $placeholder) {
|
||||
$elements = $this->renderPlaceholder($placeholder, $elements);
|
||||
// The 'status messages' placeholder needs to be special cased, because it
|
||||
// depends on global state that can be modified when other placeholders are
|
||||
// being rendered: any code can add messages to render.
|
||||
// This violates the principle that each lazy builder must be able to render
|
||||
// itself in isolation, and therefore in any order. However, we cannot
|
||||
// change the way drupal_set_message() works in the Drupal 8 cycle. So we
|
||||
// have to accommodate its special needs.
|
||||
// Allowing placeholders to be rendered in a particular order (in this case:
|
||||
// last) would violate this isolation principle. Thus a monopoly is granted
|
||||
// to this one special case, with this hard-coded solution.
|
||||
// @see \Drupal\Core\Render\Element\StatusMessages
|
||||
// @see https://www.drupal.org/node/2712935#comment-11368923
|
||||
|
||||
// First render all placeholders except 'status messages' placeholders.
|
||||
$message_placeholders = [];
|
||||
foreach ($elements['#attached']['placeholders'] as $placeholder => $placeholder_element) {
|
||||
if (isset($placeholder_element['#lazy_builder']) && $placeholder_element['#lazy_builder'][0] === 'Drupal\Core\Render\Element\StatusMessages::renderMessages') {
|
||||
$message_placeholders[] = $placeholder;
|
||||
}
|
||||
else {
|
||||
$elements = $this->renderPlaceholder($placeholder, $elements);
|
||||
}
|
||||
}
|
||||
|
||||
// Then render 'status messages' placeholders.
|
||||
foreach ($message_placeholders as $message_placeholder) {
|
||||
$elements = $this->renderPlaceholder($message_placeholder, $elements);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -788,17 +788,17 @@ function hook_render_template($template_file, $variables) {
|
|||
* A module may implement this hook in order to alter the element type defaults
|
||||
* defined by a module.
|
||||
*
|
||||
* @param array $types
|
||||
* @param array $info
|
||||
* An associative array with structure identical to that of the return value
|
||||
* of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo().
|
||||
*
|
||||
* @see \Drupal\Core\Render\ElementInfoManager
|
||||
* @see \Drupal\Core\Render\Element\ElementInterface
|
||||
*/
|
||||
function hook_element_info_alter(array &$types) {
|
||||
function hook_element_info_alter(array &$info) {
|
||||
// Decrease the default size of textfields.
|
||||
if (isset($types['textfield']['#size'])) {
|
||||
$types['textfield']['#size'] = 40;
|
||||
if (isset($info['textfield']['#size'])) {
|
||||
$info['textfield']['#size'] = 40;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue