Commit 80a0318b authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/ISTWCMS-4943-ebremner-revisions-page-error' into '1.0.x'

ISTWCMS-4943: adding check to ensure that we get a node object on a revisions page

See merge request !40
parents a91dc1e5 1aac98e5
......@@ -9,6 +9,7 @@ use Drupal\Core\Url;
use Drupal\file\Plugin\Field\FieldType\FileFieldItemList;
use Drupal\image\Plugin\Field\FieldType\ImageItem;
use Drupal\Core\Form\FormStateInterface;
use Drupal\node\Entity\Node;
* @file
......@@ -395,6 +396,14 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
// Load the node.
$node = \Drupal::routeMatch()->getParameter('node');
// ISTWCMS-4943: ensure that we get a node object.
// If node is not object by this point, probably on
// a revision page where node is an integer, so load
// the node.
if (!is_object($node)) {
$node = Node::load($node);
// If there is a node, check that it has a featured image.
if ($node) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment