Posted by jcisio on November 7, 2009 at 4:08pm
Jump to:
| Project: | Panels |
| Version: | 6.x-3.3 |
| Component: | Panel pages |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Hello,
I'd like to be confirmed that hook_filter is not called in panel pages. For example, I create a new panel page at article/%node to replace the default node/%node. When I view node/ID the filters apply to all text, but it is not the case for article/ID.
Regards.
Comments
#1
It depends on the content you put into the panel.
hook_filter isn't called for all text on a node. A filter format is applied to the body text, and possibly other fields depending upon their settings.
Since your base assumption is wrong, I can't really tell you any more without some specifics. Please see the issue submission guidelines for some details and suggestions.
#2
In fact I meant filters are not applied on the body text. Below is what I do:
- Create a new story content ID
- Install the wordfilter module http://drupal.org/project/wordfilter (which uses hook_nodeapi to censor node title, hook_filter to censor body text)
- Test and verify that this filter is applied on
node/ID, on both title and body text.- Create new panel pages on
article/%node- On this panel page, I click "Add content" -> "Node" -> "Node body", then Update, save. OK.
- When I go to article/ID, the title is filtered, but the body text is not.
- When I go to node/ID, the title is filtered, and the body text is.
#3
In the code, the pane is created thusly:
<?php$block->content = check_markup($node->body, $node->format, FALSE);
?>
In the Node: Body content, it *is* run through the filters for the specified format on the node; check_markup() is the proper way to filter the content. I don't see anything special in the word filter module that might cause this not to work, either. It's not obvious to me what might be going on here.
#4
Apparently different formats were applied. I enable the filter on all formats and it's ok.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
Sorry that I have to open this issue again.
Repeat steps in #2 works indeed. But in step 5, when I use "node content" instead of "node body", filters don't work. The different between them is that node content has the "Treat this as the primary node page" option (so that it works with menu trails).
I was searching in the code of Panels 3.3 (and even Views 2.8) but I can't see your check_markup line anywhere.
#7
There isn't a check_markup() when using the "node content" pane because we call through to Drupal via the use of node_build_content which handles that for us.
#8
btw you can see exactly what happens there in ctools/plugins/content_types/node_context/node_content.inc I believe (hopefully I got that path right, I did it from memory so it could be slightly wrong)