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 am experiencing problems with the Printer-friendly URLs list in combination with embedded views.
When using embedded views, I get a printer-friendly URL to edit that embedded view. I suppose it is created from the contextual links that come with the embedded view. A possible solution could be to check the access callbacks for every link to only include links that are to be accessed by the public? Or the module could simply be aware of what contextual links are and filter them out.
Please correct me if I am wrong.
Cheers,
Felix
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedHello,
Yes, I also saw those contextual links. I committed the fix to git on August 20th, so it's only on the dev version at the moment.
Comment #2
felixSchl CreditAttribution: felixSchl commentedThanks,
I just downloaded the dev version to try it out, but it still does not seem to work. I flushed the cache and ran update.php and all.
I still get printer-friendly URLs looking like this for example:
/admin/structure/views/view/my_view/edit/my_view_embed?destination=print/7
Comment #3
jcnventura CreditAttribution: jcnventura commentedComment #4
felixSchl CreditAttribution: felixSchl commentedThis problem is not solved in the latest version. I think you are talking about hiding contextual links on blocks. I am embedding a view on my node page.
Anyway, I "fixed" it for me - quick and dirty. The check needs to be done somewhere in between lines 359 and 371 of print.pages.inc (dev version of 18.09.11).
So I just added: if ( preg_match('/^\/admin/i', $url) ) return; on line 361 to check if the link links to an admin page. It would probably be nicer to do an permission check to only show links that are publicly available or something...
Cheers,
Felix