- Issue created by @rclemings
- Status changed to Needs review
10 months ago 8:06pm 8 March 2024 - Status changed to Fixed
10 months ago 12:41pm 12 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.
Fields that are marked as hidden (exclude from display) in view do not produce tokens for use in subsequent fields. The "if" at line 48 of /src/Plugin/views/row/PDFFields.php appears to be the cause. If it's removed the tokens reappear and no other bad things seem to happen.
Create a Views PDF display with fields that are excluded for display. Then try to use their tokens in a subsequent field. No dice.
(lines 48-69 of /views_pdf/src/Plugin/views/row/PDFFields.php)
foreach ($this->view->field as $id => $field) {
//if (empty($field->options['exclude'])) {
$options = $this->options['formats'][$id] ?? [];
switch ($this->view->getStyle()->pluginId) {
case 'pdf_unformatted':
// Register the row for header & footer on the current page before writing
// each field. This is necessary in case the fields for one record span
// multiple pages, or there is a page break. Otherwise there can be pages
// with missing headers and footers.
$this->pdf->setHeaderFooter($row, $this->options, $this->view);
$this->pdf->drawContent($row, $options, $this->view, $id);
break;
case 'pdf_grid':
$options['grid'] = $this->options['grid'];
$this->pdf->drawContent($row, $options, $this->view, $id);
$this->options['grid']['new_cell'] = FALSE;
break;
}
//}
}
Merge request enroute.
None
None
None
Fixed
3.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.