This does not work since inline only checks for $op == 'view' in inline_nodeapi
book module will call is with $op = 'print'
change
function inline_nodeapi(&$node, $op, $arg) {
if(is_array($node->files) && $op == 'view') {
into
function inline_nodeapi(&$node, $op, $arg) {
if(is_array($node->files) && ($op == 'view' || $op == 'print')) {
to fix it.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | book-node-export-html.tpl_.php_.txt | 847 bytes | toemaz |
| #7 | patch_8.patch | 875 bytes | bwynants |
| #1 | inline.module.print_.patch | 692 bytes | sun |
Comments
Comment #1
sunComment #2
sunCommitted. Thanks for this hint.
Comment #3
(not verified) commentedComment #4
bwynants commenteddoes not work in 5.0 anymore....
needs a change in 'book' module....
Comment #5
sunIt seems that book.module is not using the 'print' operation anymore. Because of that, modules like Inline are not able to check if the current node shall be printed instead of viewed. Is there a workaround for this issue?
Comment #6
bwynants commentedreplace book_node_visitor_html_pre with the function I posted. I think this should be changed in book.module cvs...
book does do a node_invoke_nodeapi($node, 'print');
however body or teaser are not in text format yet at that moment the structured $node->content is available.
the function i posted fills in $node->body before calling node_invoke_nodeapi just like node does just before calling 'alter'. for me it works now...
Comment #7
bwynants commentedpatch added
Comment #8
drummI would consider this an API change. Modules built to work with $node->content, rather than body, would break if this were applied to 5.x.
Comment #9
bwynants commentedCan you give an example here?
The patch does exactly the same thing as what node does with hook 'alter'
modules relying on $node->content will not work with alter either...
Comment #10
pwolanin commentedIs this report still relevant to 6.x? In 6.x book module invokes nodeapi('view') with a node build module of NODE_BUILD_PRINT.
Comment #11
sunComment #12
toemaz commentedI'm running against the same problem on Drupal 6.
I'm trying to port the patch, but it doesn't seem obvious at all. Apparently, Drupal 6 changed quite a lot the book module. Has someone been able to apply this patch on the D6 version of the book module?
Comment #13
toemaz commentedThe only way I could solve this issue was by changing the core book module and adding node_invoke_nodeapi($node, 'print'); in the book_node_export function.
Comment #14
toemaz commentedOr by overriding the theme book_node_export_html function. See attached the solution.
Comment #15
sunThanks for taking the time to report this issue.
However, marking as duplicate of #172613: Inline API: Solve all problems..
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.