Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
@ -14,18 +14,18 @@ use Drupal\user\Entity\Role;
|
|||
*/
|
||||
function node_views_query_substitutions(ViewExecutable $view) {
|
||||
$account = \Drupal::currentUser();
|
||||
return array(
|
||||
return [
|
||||
'***ADMINISTER_NODES***' => intval($account->hasPermission('administer nodes')),
|
||||
'***VIEW_OWN_UNPUBLISHED_NODES***' => intval($account->hasPermission('view own unpublished content')),
|
||||
'***BYPASS_NODE_ACCESS***' => intval($account->hasPermission('bypass node access')),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_views_analyze().
|
||||
*/
|
||||
function node_views_analyze(ViewExecutable $view) {
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
// Check for something other than the default display:
|
||||
if ($view->storage->get('base_table') == 'node') {
|
||||
foreach ($view->displayHandlers as $display) {
|
||||
|
@ -38,7 +38,7 @@ function node_views_analyze(ViewExecutable $view) {
|
|||
$authenticated_role = Role::load(RoleInterface::AUTHENTICATED_ID);
|
||||
$authenticated_has_access = $authenticated_role && $authenticated_role->hasPermission('access content');
|
||||
if (!$anonymous_has_access || !$authenticated_has_access) {
|
||||
$ret[] = Analyzer::formatMessage(t('Some roles lack permission to access content, but display %display has no access control.', array('%display' => $display->display['display_title'])), 'warning');
|
||||
$ret[] = Analyzer::formatMessage(t('Some roles lack permission to access content, but display %display has no access control.', ['%display' => $display->display['display_title']]), 'warning');
|
||||
}
|
||||
$filters = $display->getOption('filters');
|
||||
foreach ($filters as $filter) {
|
||||
|
@ -46,7 +46,7 @@ function node_views_analyze(ViewExecutable $view) {
|
|||
continue 2;
|
||||
}
|
||||
}
|
||||
$ret[] = Analyzer::formatMessage(t('Display %display has no access control but does not contain a filter for published nodes.', array('%display' => $display->display['display_title'])), 'warning');
|
||||
$ret[] = Analyzer::formatMessage(t('Display %display has no access control but does not contain a filter for published nodes.', ['%display' => $display->display['display_title']]), 'warning');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ function node_views_analyze(ViewExecutable $view) {
|
|||
foreach ($view->displayHandlers as $display) {
|
||||
if ($display->getPluginId() == 'page') {
|
||||
if ($display->getOption('path') == 'node/%') {
|
||||
$ret[] = Analyzer::formatMessage(t('Display %display has set node/% as path. This will not produce what you want. If you want to have multiple versions of the node view, use panels.', array('%display' => $display->display['display_title'])), 'warning');
|
||||
$ret[] = Analyzer::formatMessage(t('Display %display has set node/% as path. This will not produce what you want. If you want to have multiple versions of the node view, use panels.', ['%display' => $display->display['display_title']]), 'warning');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue