From e985a461a0148811a8a12245c48b6f5c2e5bd6c2 Mon Sep 17 00:00:00 2001 From: Florent Torregrosa Date: Fri, 8 May 2015 10:40:39 +0200 Subject: [PATCH] Issue #2479177: Fix protected_node_protected_node_hide removing information needed for other modules. --- protected_node.module | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/protected_node.module b/protected_node.module index 4906abc..6b915c9 100644 --- a/protected_node.module +++ b/protected_node.module @@ -664,7 +664,13 @@ function protected_node_protected_node_hide(&$node) { } $node->teaser = ''; $node->body = ''; - $node->content = array(); + // Does not remove the keys starting with '#' as they usually contain + // information for other modules. + foreach ($node->content as $content_key => $content) { + if (substr($content_key, 0, 1) !== "#") { + unset($node->content[$content_key]); + } + } } -- 2.1.4