Skip to content
Snippets Groups Projects
Commit 028adc69 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5880: fixing node preprocess for anon users

parent 898bfa4f
No related branches found
No related tags found
3 merge requests!284Feature/istwcms 5880 ebremner banners above,!274Draft: ISTWCMS-5551: fixing office hours display,!260Feature/istwcms 5668 a5kulkar rename references to publications
......@@ -19,6 +19,7 @@ use Drupal\field\Entity\FieldStorageConfig;
use Drupal\fillpdf\Controller\HandlePdfController;
use Drupal\fillpdf\Form\FillPdfFormForm;
use Drupal\media_library\MediaLibraryState;
use Drupal\node\Entity\Node;
use Drupal\user\UserInterface;
use Drupal\uw_cfg_common\Service\UWService;
use Drupal\webform\WebformInterface;
......@@ -597,13 +598,15 @@ function uw_cfg_common_preprocess_node(&$variables) {
// Return empty render array if user doesn't have access.
// $access_result can be boolean or an AccessResult class.
if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) {
return [];
}
$render = $plugin_block->build();
if (
is_object($access_result) &&
$access_result->isForbidden() ||
is_bool($access_result)
&& $access_result
) {
$variables['uw_content_moderation_form'] = $render;
$variables['uw_content_moderation_form'] = $plugin_block->build();
}
}
// Set the media flags for the node.
......
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