Clean install with Drupal 7.39, CTools 1.9 / latest dev and Rules 2.9.

Steps to recreate:

  1. Create a Rule for "Content is viewed". I chose to redirect to a user page. Rule works fine.
  2. Enable Panels and Page Manager. Create a variant and add a Pane with full node content. Rule is now broken and nothing is logged for Rules.
  3. Disable variant and Rule works fine again.

This is a severe issue and has completely broken my site.

Comments

niallmurphy-ie created an issue. See original summary.

niallmurphy-ie’s picture

Ok, narrowed down the change..

In 1.17 ctools\page_manager\plugins\tasks\node_view.inc

/**
 * Entry point for our overridden node view.
 *
 * This function asks its assigned handlers who, if anyone, would like
 * to run with it. If no one does, it passes through to Drupal core's
 * node view, which is node_page_view().
 */
function page_manager_node_view_page($node) {
  // Prep the node to be displayed so all of the regular hooks are triggered.
  // Also save the output for later, in case it is needed.
  $default_output = node_page_view($node);

  // Load my task plugin
  $task = page_manager_get_task('node_view');

  // Load the node into a context.
  ctools_include('context');
  ctools_include('context-task-handler');

  // Load all contexts.
  $contexts = ctools_context_handler_get_task_contexts($task, '', array($node));

  // Build the full output using the configured CTools plugin.
  $output = ctools_context_handler_render($task, '', $contexts, array($node->nid));
  if ($output !== FALSE) {
    node_tag_new($node);
    return $output;
  }

  // Try loading an override plugin.
  foreach (module_implements('page_manager_override') as $module) {
    $call = $module . '_page_manager_override';
    if (($rc = $call('node_view')) && function_exists($rc)) {
      return $rc($node);
    }
  }

In 1.19 ctools\page_manager\plugins\tasks\node_view.inc

/**
 * Entry point for our overridden node view.
 *
 * This function asks its assigned handlers who, if anyone, would like
 * to run with it. If no one does, it passes through to Drupal core's
 * node view, which is node_page_view().
 */
function page_manager_node_view_page($node) {
  // Load my task plugin
  $task = page_manager_get_task('node_view');

  // Load the node into a context.
  ctools_include('context');
  ctools_include('context-task-handler');

  // Load all contexts.
  $contexts = ctools_context_handler_get_task_contexts($task, '', array($node));

  // Build the full output using the configured CTools plugin.
  $output = ctools_context_handler_render($task, '', $contexts, array($node->nid));
  if ($output !== FALSE) {
    node_tag_new($node);
    return $output;
  }

  // Try loading an override plugin.
  foreach (module_implements('page_manager_override') as $module) {
    $call = $module . '_page_manager_override';
    if (($rc = $call('node_view')) && function_exists($rc)) {
      return $rc($node);
    }
  }

  // Prepare the node to be displayed so all of the regular hooks are triggered.
  $default_output = node_page_view($node);

I have no idea what any of it means but is the change necessary? Swapping the file seems to fix the problem and cause no ill effects in limited testing.. Would love a response on whether or not this was part of the security fix. Thanks.

alesr’s picture

This issue is not displaying my default images on node view panel page.

Here's the diff:

diff --git a/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/node_view.inc b/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/no$
index ad754e0..89a2912 100644
--- a/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/node_view.inc
+++ b/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/node_view.inc
@@ -78,10 +78,6 @@ function page_manager_node_view_menu_alter(&$items, $task) {
  * node view, which is node_page_view().
  */
 function page_manager_node_view_page($node) {
-  // Prep the node to be displayed so all of the regular hooks are triggered.
-  // Also save the output for later, in case it is needed.
-  $default_output = node_page_view($node);
-
   // Load my task plugin
   $task = page_manager_get_task('node_view');
 
@@ -107,6 +103,9 @@ function page_manager_node_view_page($node) {
     }
   }
 
+  // Prepare the node to be displayed so all of the regular hooks are triggered.
+  $default_output = node_page_view($node);
+
   // Otherwise, fall back to the default output generated by node_page_view().
   return $default_output;
 }
alesr’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Patch that solves this issue.
$default_output = node_page_view($node);
Moved to the top of the page_manager_node_view_page() function.

Status: Needs review » Needs work

The last submitted patch, 4: ctools-panel-node-view-broken-2556253-4.patch, failed testing.

alesr’s picture

Status: Needs work » Needs review
StatusFileSize
new976 bytes

Fixed path in patch #5.

niallmurphy-ie’s picture

Will this be committed to the next release?

Jeroen94’s picture

Title: Critical: 1.18 / 1.19 breaks rule "content is viewed" if page is a panel. Easily recreatable with just panels, ctools and rules. » Rule "Content is viewed" is not triggered when full content is displayed in a panel.
Status: Needs review » Reviewed & tested by the community
Issue tags: -break, -1.19, -panels

I'm having the same problem on my website. Applying patch #6 solved it!

Jeroen94’s picture

Title: Rule "Content is viewed" is not triggered when full content is displayed in a panel. » Rule "Content is viewed" is not triggered when full content is displayed in a Panel.
Issue summary: View changes
Issue tags: +Quick fix
niallmurphy-ie’s picture

Hi, this fix didn't get included in the 1.10 release.

Is this a ctools, rules or panels issue? Thanks.

rivimey’s picture

I'm trying to help japerry get ctools-1.11 out the door.

The change that appears to have caused this is 2437773. I am concerned that simply reverting that change (which is essentially what this patch does) may fix this issue but break something else, so I have commented on that thread asking for assistance.

If others here could comment that would be helpful too.

rivimey’s picture

niallmurphy-ie’s picture

Thanks for looking into it.. I may as well be looking at Chinese when it comes to the big modules.

japerry’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs review

I too am worried about what this will do. Marking needs review until a few more ctools users get a look at it.

niallmurphy-ie’s picture

7.x-1.12 still doesn't address this issue.

alesr’s picture

Stumbled upon this issue after years writing the patch for it.

This time I had to add js after a specific node type is viewed.
If you are using Panels after Ctools version 7.x-1.8, hook_node_view() is not called when viewing node panel page. It was called before this Display Suite issue came in and the patch that caused all the trouble was committed without proper testing: https://www.drupal.org/project/ctools/issues/2437773

Now we have to call hook_ctools_render_alter() to get similar functionality but it's not the most effective way to do it.

The question is... Is this regression problem going to be fixed?

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch in #6 does not apply to the latest ctools 7.x-1.x-dev.

akashkumar07’s picture

Status: Needs work » Needs review
StatusFileSize
new659 bytes

#6 Rerolled

abryenton@gmail.com’s picture

#18 works great for me using ctools-7.x-1.x-dev