When clicking the Settings link (Views Style Plugin) with PDF Table selected, I get the following errors:

Notice: Undefined index: exclude in .../views_pdf/views_pdf_plugin_style_table.inc on line 87
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 129
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 135
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 143
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 151
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 206
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 212
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 220
Notice: Undefined index: title in .../views_pdf/views_pdf_plugin_style_table.inc on line 228
(with similar errors for each additional field)

I hit this error in 7.x-1.4 , and so then upgraded to the latest dev version 7.x-1.x-dev dated January 26, both give the same error.

The pdf generates at the page url as expected.

Any ideas what could cause this? For the pdf libraries, I am running:
FPDI 1.5.2
TCPDF 6.0.098

Thanks for your help!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vegansupreme’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Priority: Major » Normal

These are notices only. The view and settings work fine? Are these messages showing up on the view UI page, or in logs only?

vegansupreme’s picture

Status: Active » Needs review
FileSize
6.65 KB

@captaindav, see if this patch fixes the notices. Those lines seem to be checking for NULL, but they should be checking for !isset().

killua99’s picture

Status: Needs review » Needs work
+++ b/views_pdf_plugin_style_table.inc
@@ -84,7 +84,7 @@ class views_pdf_plugin_style_table extends views_plugin_style {
+      if (isset($fields[$field]['exclude']) && $fields[$field]['exclude'] == 1) {

To:

if (!empty($fields[$field]['exclude']) && $fields[$field]['exclude'] == 1) {

Use empty instead.

Is like a better way to confirm that is set + have something useful.

The odd part is, why he's getting those Notices.

killua99’s picture

Assigned: Unassigned » vegansupreme
vegansupreme’s picture

In my testing, I only got these errors the very first time a table PDF is set up. After that, default values are filled in. Is there a way to set these values earlier? But not reset values once they've been entered?
Otherwise, I'll switch to empty()

killua99’s picture

Ummm ok, Maybe is something with the views API that we've something wrong.

killua99’s picture

Status: Needs work » Closed (outdated)