Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -28,12 +28,15 @@ use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\node\NodeInterface;
use Drupal\node\NodeTypeInterface;
use Drupal\user\UserInterface;
/**
* Denotes that the node is not published.
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::NOT_PUBLISHED instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_NOT_PUBLISHED = 0;
@ -42,6 +45,8 @@ const NODE_NOT_PUBLISHED = 0;
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::PUBLISHED instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_PUBLISHED = 1;
@ -50,6 +55,8 @@ const NODE_PUBLISHED = 1;
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::NOT_PROMOTED instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_NOT_PROMOTED = 0;
@ -58,6 +65,8 @@ const NODE_NOT_PROMOTED = 0;
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::PROMOTED instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_PROMOTED = 1;
@ -66,6 +75,8 @@ const NODE_PROMOTED = 1;
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::NOT_STICKY instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_NOT_STICKY = 0;
@ -74,6 +85,8 @@ const NODE_NOT_STICKY = 0;
*
* @deprecated Scheduled for removal in Drupal 9.0.x.
* Use \Drupal\node\NodeInterface::STICKY instead.
*
* @see https://www.drupal.org/node/2316145
*/
const NODE_STICKY = 1;
@ -92,7 +105,7 @@ function node_help($route_name, RouteMatchInterface $route_match) {
else {
$message = t('The content access permissions need to be rebuilt. <a href=":node_access_rebuild">Rebuild permissions</a>.', [':node_access_rebuild' => \Drupal::url('node.configure_rebuild_confirm')]);
}
drupal_set_message($message, 'error');
\Drupal::messenger()->addError($message);
}
switch ($route_name) {
@ -121,7 +134,7 @@ function node_help($route_name, RouteMatchInterface $route_match) {
case 'entity.entity_form_display.node.default':
case 'entity.entity_form_display.node.form_mode':
$type = $route_match->getParameter('node_type');
return '<p>' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', ['%type' => $type->label()]) . '</p>' ;
return '<p>' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', ['%type' => $type->label()]) . '</p>';
case 'entity.entity_view_display.node.default':
case 'entity.entity_view_display.node.view_mode':
@ -535,9 +548,12 @@ function template_preprocess_node_add_list(&$variables) {
* Implements hook_preprocess_HOOK() for HTML document templates.
*/
function node_preprocess_html(&$variables) {
// If on an individual node page, add the node type to body classes.
if (($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof NodeInterface) {
$variables['node_type'] = $node->getType();
// If on an individual node page or node preview page, add the node type to
// the body classes.
if (($node = \Drupal::routeMatch()->getParameter('node')) || ($node = \Drupal::routeMatch()->getParameter('node_preview'))) {
if ($node instanceof NodeInterface) {
$variables['node_type'] = $node->getType();
}
}
}
@ -593,9 +609,9 @@ function template_preprocess_node(&$variables) {
$variables['node'] = $variables['elements']['#node'];
/** @var \Drupal\node\NodeInterface $node */
$node = $variables['node'];
$variables['date'] = drupal_render($variables['elements']['created']);
$variables['date'] = \Drupal::service('renderer')->render($variables['elements']['created']);
unset($variables['elements']['created']);
$variables['author_name'] = drupal_render($variables['elements']['uid']);
$variables['author_name'] = \Drupal::service('renderer')->render($variables['elements']['uid']);
unset($variables['elements']['uid']);
$variables['url'] = $node->url('canonical', [
@ -698,7 +714,7 @@ function node_ranking() {
/**
* Implements hook_user_cancel().
*/
function node_user_cancel($edit, $account, $method) {
function node_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish nodes (current revisions).
@ -794,7 +810,7 @@ function node_get_recent($number = 10) {
* the global content language of the current request.
*
* @return array
* An array as expected by drupal_render().
* An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
return entity_view($node, $view_mode, $langcode);
@ -812,7 +828,8 @@ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
* content language of the current request.
*
* @return array
* An array in the format expected by drupal_render().
* An array in the format expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) {
return entity_view_multiple($nodes, $view_mode, $langcode);
@ -828,7 +845,7 @@ function node_page_top(array &$page) {
$page['page_top']['node_preview'] = [
'#type' => 'container',
'#attributes' => [
'class' => ['node-preview-container', 'container-inline']
'class' => ['node-preview-container', 'container-inline'],
],
];
@ -1022,7 +1039,6 @@ function node_access_view_all_nodes($account = NULL) {
return $access[$account->id()];
}
/**
* Implements hook_query_TAG_alter().
*
@ -1099,7 +1115,7 @@ function node_query_node_access_alter(AlterableInterface $query) {
// context.
$request = \Drupal::requestStack()->getCurrentRequest();
$renderer = \Drupal::service('renderer');
if ($request->isMethodSafe() && $renderer->hasRenderContext()) {
if ($request->isMethodCacheable() && $renderer->hasRenderContext()) {
$build = ['#cache' => ['contexts' => ['user.node_grants:' . $op]]];
$renderer->render($build);
}
@ -1173,7 +1189,7 @@ function node_access_rebuild($batch_mode = FALSE) {
'operations' => [
['_node_access_rebuild_batch_operation', []],
],
'finished' => '_node_access_rebuild_batch_finished'
'finished' => '_node_access_rebuild_batch_finished',
];
batch_set($batch);
}
@ -1209,7 +1225,7 @@ function node_access_rebuild($batch_mode = FALSE) {
}
if (!isset($batch)) {
drupal_set_message(t('Content permissions have been rebuilt.'));
\Drupal::messenger()->addStatus(t('Content permissions have been rebuilt.'));
node_access_needs_rebuild(FALSE);
}
}
@ -1282,11 +1298,11 @@ function _node_access_rebuild_batch_operation(&$context) {
*/
function _node_access_rebuild_batch_finished($success, $results, $operations) {
if ($success) {
drupal_set_message(t('The content access permissions have been rebuilt.'));
\Drupal::messenger()->addStatus(t('The content access permissions have been rebuilt.'));
node_access_needs_rebuild(FALSE);
}
else {
drupal_set_message(t('The content access permissions have not been properly rebuilt.'), 'error');
\Drupal::messenger()->addError(t('The content access permissions have not been properly rebuilt.'));
}
}