Here is a patch to add compatibility for Views PDF This patch will allow the user to include a PDF display within another PDF display. This is useful for inserting tables, and other advanced layout in PDFs.

There is currently a known bug in Views PDF that duplicates included content #2072889: Include View Duplicates Content
So when evaluating this patch, please be aware the duplicated content is expected, for now, and it's not a problem with this patch or Views Field View.

Also, this is not my patch, it was contributed by Drupal user TBarina. I could suggest a commit message if it will help.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killua99’s picture

Status: Needs review » Needs work
  1. +++ b/views_field_view_handler_field_view.inc
    @@ -426,6 +426,13 @@ class views_field_view_handler_field_view extends views_handler_field {
    +          if (isset($this->view->pdf) && is_object($this->view->pdf)) {
    

    I'll add this.

    if (module_exists('views_pdf') && is_object($this->view->pdf)) { ... } 
    
  2. +++ b/views_field_view_handler_field_view.inc
    @@ -426,6 +426,13 @@ class views_field_view_handler_field_view extends views_handler_field {
    +            $view->pdf =& $this->view->pdf;
    

    I don't know if this is correct, shouldn't be like $view->pdf = &$this->view->pdf; ?

vegansupreme’s picture

Updated patch. I don't know about = &, but I'll defer to your judgement, Killua99.

killua99’s picture

Status: Needs work » Needs review

look good, lets see what the bot says

dawehner’s picture

Wel, I think maintainers of the modules disagree that this should be part of the module.

damiankloip’s picture

How about just using hook_views_pre_view and adding what you need there?

killua99’s picture

Well the thing is, we've the same exact module *hacked* on views_pdf because of that lines. this views_field_view is very used in combination with views_pdf.

I'm gonna thing how we can alter that class from our module. Still we thought this is the right place, that views_field_view support views_pdf and not in the other way.

Please rethink one last time. You can find me on IRC drupal-contribute mostly or twitter to chat about it

I'll wait feedback from @vegansupreme tho.