Hi, I need to have links for my teasers and my full nodes, as requested in Issue: Print link not in teaser. I've edited the *_link_allowed functions and that seems to be working fine (you can see the patch file here) in 'normal' situations.
On my homepage I use a content type called Article Position as a part of the layout workflow. The idea is that editors don't have access to the Panel I use to create the homepage layout, but they do have edit permissions for Article Position, which is nothing more than a Node Reference to type News Article. So I can lock the positions into the Panel, and the editors can alter the nodereference, and therefore which article displays in each position. (Actually, this is basically the same kind of functionality found in Nodequeue, but I didn't know that when I implemented it).
The problem I'm facing is that if I switch on printer-friendly links for Article Position then I get double links - one for the Article Position and one for the News Article referred to by the position. But if I switch off printer-friendly links for Article Position then the links go for both content types! (It's slightly stranger than this - the email and pdf links won't show, but the vanilla pf link will.)
I did some simple debug printing (I don't know anything about debugging PHP): within the pdf module and discovered that print_pdf_link_allowed() was consistently returning FALSE because $nodetype was always Article Position even when the node passed in is of a different type. It seems that that's something to do with the static declaration of $nodetype and so I presume there's a reason for it, but I'm out of my depth a bit here. Any help would be much appreciated!
Btw I do have lots of funky templates overriding node display, but I temporarily switched theme to unadulterated Garland and the problem remained.
Comments
Comment #1
andyf commentedSo temporarily I've just changed this in
print_[mail|pdf]_link_allowedto this
But would love to understand why it has this static first-nodetype-overrides-other-nodetypes design, it's obviously not by accident!
Comment #2
andyf commentedAdditional info: sorry, forgot all about this - the Article Position is within a Panel pane, and the pane is set to include node links. This might be a factor...
Comment #3
jcnventuraHi andyF,
The reason for the first-nodetype-overrides-other-nodetypes design is to be able to specify printer-friendly links in individual comments.. When building the links area for each comment, it's no longer possible to access the current node type, as the comment has no info on that. Since the display of comments is also a per-content-type setting I need to know it.
However, the code in the first part of #1 is no longer current, as a result of #480916: Correction of a bug printing a node inside another.... That issue was fixed in 6.x-1.8, so I would like to ask you to update to the current version.
João
Comment #4
andyf commentedHi João, thanks for getting back to me. I think I understand what you're saying about comments ;)
I think it is! I have 6.x-1.10 installed. I wonder if that explains why I only had the problem with email and PDF links - maybe you fixed it in print.module, but not in the submodules?
Does that make sense?
Comment #5
jcnventuraIt does make a LOT of sense.. I must have forgotten to update the others.. That's one of the reasons why I want to refactor all this link handling stuff.
I'll do it soon.
Comment #6
andyf commentedThanks João
Comment #7
marty.true commentedI have a similar issue....
I am using nodereferences to combine 3 pieces of content into 1 final piece and the print_pdf does not glue all the content in the pdf that is built. The only way to come close is to turn the PDF on for all 3 content types and then, like above, I get 3 different sets of icons/links.
What I am trying to achieve is to be able to build a PDF out of the final displayed node (that combines using nodereference). I hope I am being clear what the issue is and what I need...
Please advise, this is a hot topic for us!
Comment #8
andyf commentedHi xstatic
AFAIK what you want should be quite easy. Can you check that you've
I think that should be enough. HTH.
Comment #9
jcnventuraHi,
I've just fixed #480916: Correction of a bug printing a node inside another... properly, including the correct code for the mail and pdf links.
I'm marking this as a duplicate again.
João