This happens when I use Table format. unformatted works - that is it creates a document.
I've attached the error message.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hunziker’s picture

It seems that you have a exclude a field in the view. Remove this field. Something is wrong with it.

prjcarr’s picture

Hi Hunziker,

I am having the same problem. I am getting the above error if I have any fields excluded. Once I untick "exclude" the pdf renders, but unfortunatley it then shows all fields which is not suitable for my application. I cant totally remove the fields either because other rendered fields (rewritten output) depend on them.

Is there a fix for this?

Thanks

hunziker’s picture

The problem is that, we need to render the excluded fields, because we need the output for the token system.

I need to think about it how we can solve this correct. Hot fix is to remove the line 509 in views_pdf_template.php.

hunziker’s picture

Status: Active » Closed (fixed)

Latest commit contains a bug fix for this.

essbee’s picture

Is that fix being ported to 7.x?

berliner’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Closed (fixed) » Active
FileSize
436 bytes

Reopening because the bug is still there.
Tested with dev and 1.0.

The error is triggered here:

if ($row != null && $view != null && !preg_match('/\.pdf/', $template)) {
  return $view->field[$template]->theme($row);
}

$template is actually the template name without the extension, that's why the preg_match call does return FALSE. There is no views field with the template name though. A work around that works for me is to add a check to see if $template is a key in $view->field, see the attached patch.

jvieille’s picture

#6 works for me
Thanks for the patch

Simon Georges’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Patch (to be ported)

Committed, thanks!

Simon Georges’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Closed (fixed)

Doesn't seem to be needed in 7.x.