I'm thinking of using hidden paths to have content aimed at site editors and to avoid using a content access module. However, I wouldn't want the hidden paths message ("Only people with the View hidden paths permission will be able to view this page. Everyone else will receive a "Page not found" error") to show up on each page. Is there a way to write a custom module that would disable it for particular content types?
The function it is set is /core/modules/node/node.module > node_page_view()
I would write a custom module that implements hook_node_view_alter().
Because of the way Backdrop/D7 handle system messages, the only way to remove ONLY the info message related to the hidden path is a bit hacky. It requires you to unset a specific array item in the $_SESSION array. See below
function MYMODULE_node_view_alter($build) { $type = node_type_get_type($build['#node']); if ($type->settings['hidden_path']) { $message = t('Only people with the View hidden paths permission will be able to view this page. Everyone else will receive a "Page not found" error.'); $info_messages = !empty($_SESSION['messages']['info']) ? $_SESSION['messages']['info'] : array(); foreach ($info_messages as $delta => $info_message) { if (strpos($info_message, $message) !== FALSE) { unset($_SESSION['messages']['info'][$delta]); } } if (empty($_SESSION['messages']['info'])) { unset($_SESSION['messages']['info']); } } }