Hi

I can't get the Print block to display print and email links (block not displayed at all).

The only (and ugly) way to get them displayed is by forcing "if ($allowed_type) {" to TRUE" into the following functions : print_insert_link, print_insert_mail.

Thanks your help

Laurent

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

That variable is set by calling a function which evaluates a lot of different conditions in order to decided if allowed_type is TRUE or FALSE.. Since you seem to know PHP, it might be easier to insert some debug statements in that function to find out why it doesn't work for you.

Most of those conditions depend on a lot of different settings, so I really can't help you more than this.

If you do discover some specific situation in which the function is returning FALSE when the system is configured in a way that it should be returning TRUE, I would love to hear about it and fix it.

João

Agence Web CoherActio’s picture

Hi João

I've managed to narrow down where the issue is located but debug through.

Problem happens in the function print_link_allowed($args). More precisely in the following test:
if ((!$node->print_display) || (isset($node_type) &&

System seems to use this function twice.
First time with $node->print_display = 1 hence it shall disply the link in the block.
Second time with $node->print_display = 0 hence link is finally not displayed.

I can't figure out why this function is invoked twice

Can you help ?

Thanls

Laurent

jcnventura’s picture

It's called once for each possible link (i.e. one for the block and one for the ordinary link below or on the corner of the content.

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Active

I confirm that there is indeed a problem, and it's not your fault.. I will try to fix it soon..

João

jcnventura’s picture

Status: Active » Fixed

I have just committed a fix to this problem, please try the next devs.

João

Agence Web CoherActio’s picture

Hi João

Works perfectly with your fix!

By the way, I always get the 2 fields 'Show link' and 'Show Printer-friendly URLs list' checked by default on the node creation page whatever the set up of the respective content type. This is weird. How can I get these fields unchecked by default?

Thanks

Laurent

jcnventura’s picture

Hi,

The default option for those options is to have them TRUE. However, if the type configuration is set to FALSE, the node-specific setting is ignored (or in other words, the type-specific setting overrides the node specific setting).

This is not yet fully documented, as I am still thinking on whether this algorithm is the best one.

João

Status: Fixed » Closed (fixed)

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