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.
works fine but im getting a lot of error messages
Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (Row 1256 of /home/www/web62/html/xxxx/sites/all/modules/views/handlers/views_handler_field.inc).
(50 times an then)
Notice: Undefined variable: filename in include() (Row 17 of /home/www/web62/html/xxxx/sites/all/modules/views_export_xls/views-export-xls-view-xls.tpl.php).
I'm using a view with relationsships "Download history: User" and "Download history: File" (Download Count Module)
Comment | File | Size | Author |
---|---|---|---|
#6 | notice_undefined_variable-1414778-6.patch | 396 bytes | misterkay |
#4 | views_export_xls-missing_filename_notice-1414778-4.patch | 376 bytes | marcusx |
Comments
Comment #1
laraz CreditAttribution: laraz commentedsubscribe.
Comment #2
ZuluWarrior CreditAttribution: ZuluWarrior commentedYou can get rid of the Undefined variable error by modifying the file views-export-xls-view-xls.tpl.php. Its just poor coding in the template file, so you could override with the theme system, or (yee-haw) just modify the file in the modules directory:
Line 17, replace
if (!$filename) {
with
if (!empty($filename)) {
Comment #3
ZuluWarrior CreditAttribution: ZuluWarrior commentedThe other error, Undefined Property, is actually an error in views - fields, its discussed here:
http://drupal.org/node/1115222
and this very simple patch offered in the thread (#10) fixes the error, as usual, USE WITH CARE, we never recommend modifying Drupal or core modules code, but it does fix it for me and the nature of the fix is fairly safe (if theres no row index don't try and perform an action that causes the error)
Patch: http://drupal.org/files/issues/views_openlayers_render_tokens.patch
Anyways, hope this helps someone :)
Comment #4
marcusx CreditAttribution: marcusx commentedI created a patch for the fix in #2 as I needed it for documentation reasons in a current project.
Comment #5
marcusx CreditAttribution: marcusx commentedCleaning up a little bit and separating the two issues in this ticket.
Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (Row 1256 of /home/www/web62/html/xxxx/sites/all/modules/views/handlers/views_handler_field.inc).
Is now #1701220: Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens().
Changing the title of this one to describe the problem with the missing filename. This should also make it easier to find.
Comment #6
misterkay CreditAttribution: misterkay commentedI was looking at this as well and I want to suggest a small difference. Instead of checking just
empty()
use!isset()
first incase that variable is never defined to begin with and then check for it being empty. This should short circuit out on the!isset()
.Comment #7
creaoy CreditAttribution: creaoy commentedCommited patch #6 e847293
Comment #8
creaoy CreditAttribution: creaoy commented