I need to pass to printed node an argument in the drupal path (for example for print the page http://mysite.org/?q=node/3/argument I need the path http://mysite.org/?q=print/3/argument) but the print_controller() function don't handle the path in correct mode and don't call the correct function (_print_generate_node($nid, $cid);).

I patch the code with this snippet that work for me.
I replace line 42 of print.pages.inc with this code:
//PATCH added for permit other args after nid
$pos = strpos($args, '/');
if($pos > 0){
$nid = substr($args,0, strpos($args, '/'));
}else{
$nid = $args;
}

Comments

jcnventura’s picture

Status: Active » Fixed

Hi,

Thanks for the tip. I actually used a slightly simpler code:

$parts = explode("/", $path);
$nid = $parts[0];

I have committed this to HEAD, so the next release in the 6.x tree will have the fix.

João

SolomonGifford’s picture

Version: 6.x-1.0-rc3 » 5.x-3.x-dev

Any chance this will be backported to 5?

SolomonGifford’s picture

Sorry, its in the dev version. My bad.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.