Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jcnventura CreditAttribution: jcnventura commentedHi,
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
Comment #2
Agence Web CoherActio CreditAttribution: Agence Web CoherActio commentedHi 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
Comment #3
jcnventura CreditAttribution: jcnventura commentedIt'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
Comment #4
jcnventura CreditAttribution: jcnventura commentedI confirm that there is indeed a problem, and it's not your fault.. I will try to fix it soon..
João
Comment #5
jcnventura CreditAttribution: jcnventura commentedI have just committed a fix to this problem, please try the next devs.
João
Comment #6
Agence Web CoherActio CreditAttribution: Agence Web CoherActio commentedHi 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
Comment #7
jcnventura CreditAttribution: jcnventura commentedHi,
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