I have a couple Variants set up for my node type with Selection Rules via Page Manager. If for some reason none of the rules are met for all the variants, it renders the node using the default node system instead of sending to a 404. How can I send the user to a 403 page instead?
1 Answer
I took care of this using hook_node_view(). This will only run if it is using the node system.
/**
* Implements hook_node_view().
*/
function mymodule_node_view($node, $view_mode, $langcode) {
if ($node->type == 'collection' && $view_mode == 'full') {
drupal_access_denied();
drupal_exit();
}
}