Doc Export: Fatal error: Call to undefined method views_bonus_plugin_style_export_doc::sanitize_columns() in theme.inc?
Rosamunda - April 24, 2009 - 22:46
| Project: | Views Bonus Pack |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi there!
When I export the view in a doc file, this is the only thing that I get when I opne that file:
Fatal error: Call to undefined method views_bonus_plugin_style_export_doc::sanitize_columns() in ............\sites\all\modules\views\theme\theme.inc on line 288Rosamunda

#1
Im getting the same error.
Any more info available?
#2
I´m sorry, but I would like to bump this :)
#3
Are you sure this is beta2? I can't come up with any reason it would be trying to call this function.
#4
I´m upgrading views2 now, so I can check if it solves the issue.
Yup, I´ve got beta2 and I´ve tried it with the dev version also.
#5
Nope, the error is still there, even after upgrading views.
#6
I´ve tried all over again, within a fresh D.6 install... but the error is still there. And I´ve discovered that appears in the XML export too.
It´s ok with CVS and TXT, but it won´t work in any export if the view has arguments (even when I´ve added the % at the path, it will show up the "%" sign instead the argument number.
If I tried copying the link, paste it at the browser´s bar and replace it by hand, it will work (the file will open) but the original errors (at the first post in this queue) are still there.
#7
[453140]
this issue is specifically for the sanitize_columns error.
#8
Yes, I´ll open a new bug issue, I just thought I would tell exactly which steps I´ve followed.
Sorry about that, I´ll open a new issue to avoid confusion.
Anyway, the sanitize_columns error is still there.
#9
I´m setting this as active, because it´s not clear what is the extra info that is needed.
Thanks,
Rosamunda
#10
Yeah, I do have some new questions for you though.
1) Can you attach an export of your view?
2) Are you doing any extra theming or manipulation of any views? Is this on an unchanged core theme?
3) What version of views? and if applicable what version of any modules that might be interacting with views?
I try to set up a identical setup because I can't figure out any possible way to reproduce this. Mainly because that line is part of template_preprocess_views_view_table which has /nothing/ to do with any of the export plugins so something weird is going on.
#11
Thanks for your reply! :)
The export route inside the editing views is: listado_del_grupo/%/feeds
The link that appears when I click on the orange feed button is: listado_del_grupo/%25/feeds (the node id is 18).
The file name is view-listado_del_grupo.doc
The only output is:
Fatal error: Call to undefined method views_bonus_plugin_style_export_doc::sanitize_columns() in .../sites/all/modules/views/theme/theme.inc on line 288Yes, I´ve a special theme, but after your question I´ve tried it again with the bluemarine, with the same results.
I´ve installed Views 6.x-2.3. But I´ve tried it with 6.x-2.5 because I thought that maybe was a views issue... with the same result.
#12
I can´t belive this error appeared in only two people. Anyone out there with the same issue?
#13
same issue here... :(
I am using views 6.x-2.3 and views bonus 6.x-1.0-beta2. Find any solution already ?
Thanks.
#14
same issue here too, with Views 6.x-2.5 and Views Bonus 6.x-1.x-dev (2009-May-13 version).
I'm attaching the export version and can provide more info if you need...
Thanks
#15
I'm having the same issue as well although XML and CSV seem to work just fine. DOC give me the sanitize_columns error.
#16
I have the same error. Any solution?
#17
Confirming error and subscribing
#18
I am having the same problem. It happens whether my view is of style 'table' or of style 'unformatted'.
I think I've found the issue with the code but I'm not yet clear on how to fix it.
Here's what I see in the code:
class views_bonus_plugin_style_export_doc extends views_bonus_plugin_style_export
class views_bonus_plugin_style_export extends views_plugin_style
however, sanitize_columns() isn't in views_plugin_style, its only in class views_plugin_style_table
As an experiment, I tried changing class views_bonus_plugin_style_export to extend views_plugin_style_table but
then I get the error message : Fatal error: Class 'views_plugin_style_table' not found in ....drupal-6.12\sites\all\modules\views_bonus\export\views_bonus_plugin_style_export.inc on line 13
Also, FYI, there is a typo in views_bonus_plugin_style_export_doc.inc:
Line 54 should read '#title' => t('DOC filename'),
Here are EXPORTS of the two views:
$view = new view;
$view->name = 'student_view';
$view->description = 'View of Students';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'student';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'id' => array(
'label' => 'Student ID',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'id',
'table' => 'student',
'field' => 'id',
'relationship' => 'none',
),
'name' => array(
'label' => 'Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'name',
'table' => 'student',
'field' => 'name',
'relationship' => 'none',
),
'email' => array(
'label' => 'Email',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'email',
'table' => 'student',
'field' => 'email',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'name' => array(
'id' => 'name',
'table' => 'student',
'field' => 'name',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('title', 'List of Students');
$handler->override_option('header', 'This is a list of students that have been entered into the system. The text here is header text.');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 1);
$handler->override_option('footer', 'This is footer text');
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 0);
$handler->override_option('style_plugin', 'table');
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('sorts', array(
'name' => array(
'order' => 'ASC',
'id' => 'name',
'table' => 'student',
'field' => 'name',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('path', 'studentlist');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'List Students',
'description' => 'List of Students',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_2');
$handler->override_option('filters', array(
'name' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 1,
'operator' => 'name_op',
'identifier' => 'name',
'label' => 'Student Group: Name',
'optional' => 1,
'remember' => 0,
),
'case' => 1,
'id' => 'name',
'table' => 'student',
'field' => 'name',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('path', 'searchstudents');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Search Students',
'description' => 'Search Students by Name',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('feed', 'Feed', 'feed_1');
$handler->override_option('style_plugin', 'views_doc');
$handler->override_option('style_options', array(
'mission_description' => FALSE,
'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'studentreport');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler->override_option('displays', array(
'page_1' => 'page_1',
'default' => 0,
'page_2' => 0,
));
$handler->override_option('sitename_title', FALSE);
$view = new view;
$view->name = 'test_view2';
$view->description = 'this view won\'t use tables but is for generating a document';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'student';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'email' => array(
'label' => 'Email',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'email',
'table' => 'student',
'field' => 'email',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'name' => array(
'label' => 'Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'name',
'table' => 'student',
'field' => 'name',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'id' => array(
'label' => 'Student ID',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'id',
'table' => 'student',
'field' => 'id',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler = $view->new_display('feed', 'Feed', 'feed_1');
$handler->override_option('style_plugin', 'views_doc');
$handler->override_option('style_options', array(
'mission_description' => FALSE,
'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'docfeed');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler->override_option('displays', array(
'page_1' => 'page_1',
'default' => 0,
));
$handler->override_option('sitename_title', FALSE);
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'docpage');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'doc page',
'description' => 'Document Page',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
#19
bump?
#20
I can confirm this bug. And it is the problem DarrellDuane decsribed in #18.
It is because of this line in views-bonus-export-doc.tpl.php
$table = theme('views_view_table', $view, $nodes, null);
This line means views treats this view as a table view, so it needs the table view functions like you find in views_plugin_style_table.inc
The solution in #18 won't work either because the views_bonus_plugin_style_export class is used by other classes in views_bonus that don't want to extend the class views_plugin_style_table (like views_bonus_plugin_style_export_csv)
One solution might be to move the attach_to function from views_bonus_plugin_style_export into views_bonus_plugin_style_export_doc and then make views_bonus_plugin_style_export_doc extend views_plugin_style_table instead of views_bonus_plugin_style_export.
In theory that would solve the problem. It may not be ideal but I have yet to think of a better way.
I will be looking into a solution for this very soon as I need the functionality to work.
#21
Hi,
I've corrected the bug and also added XLS export but I don't know how to contribute it.
Also, should I correct dev version?
Thanks if you can help me.
#22
Here's the zip file of the fixed export module (made from 13 may's dev version) with XLS export added.
Also fixed t('CSV filename') and changed seperator to separator.
Sorry, don't know how to create a patch file!
#23
#24
+1 for the patched version on #22. It works just fine for me.
Please review it so it can be commited :)
#25
UPDATE: The patched version won´t work with arguments... It shows "page now found".
Still testing...
#26
Here is a patch of anrikun's changes in #22
It applies to 6.x-1.x-dev (2009-May-13). It does not apply to 6.x-1.0-beta2.
#27
Thanks for the work anrikun
@Rosamunda:
Have you tried clearing all the caches?
You can fluch all caches with the devel module and also at admin/build/views/tools you can clear the views cache.
I was having problems until I cleared the caches but it seems to be working for me now. Even with arguments & exposed filters being used.
Can you give further information? Maybe attach a text file with the export of a view with arguments that doesn't work?
#28
Yup, I´ve cleared all cache and the problem is that there is no file created at all. It just goes to a "page not found".
The argument that I´m using is from OG, to show stuff that only belongs to a certain group.
#29
Thanks for the patch Justin! I need to learn how to make patches by myself now ;-)
To Rosamunda: did arguments use to work before you apply the patch?
AFAIK I haven't changed anything related to arguments...
#30
Yup, they worked just fine. Maybe it´s because tit is a block and it is not a page?
I´m sorry for not mentioning this before, now I realize that it could be because of that...?
I´ll try it out with a page equally configured as the block...
#31
I'm not going to commit this as is because there are all sort of changes through made. Can we try to narrow down the problem?(add xls is not fixing this problem)
#32
To me this path contains 3 things:
* The fix for this .doc export bug
* Addition of .xls export
* A minor fix of some of the filename textfield titles
If this patch gets split into these three separate issues would it be committable?
#33
I don't understand why it cannot been committed as is.
It fixes bugs + adds a new feature. What's bad about that?
#34
Generally it is considered best practice and easier to follow and test if there is one issue per patch.
Some maintainers don't mind either way and some do.
#35
But the export part of views_bonus is a relatively simple module, without a lot of code, so making a patch for every single issue doesn't seem really necessary to me. Maybe then should I only remove the XLS part?
#36
Yeah, that's what I was going to suggest initially.
Just have the two issues.
#37
Here's the new file, without XLS export, made from last dev version (1st july).
#38
Ooops sorry for the previous file. Was buggy.
#39
I'm not going to apply this patch or this version of the fix because it breaks things current and future planned features with the parent class. Also, the class is already being used by contrib modules.
#40
simple fix applied to -dev.
#41
I've created an updated patch for just the export to Excel via the HTML table option mentioned above in #26. Please download and review from Issue #519424.
#42
@neclimdul
Re: #39 & #40
Can you be a bit more specific with what has been committed and what hasn't?
The part you say you won't commit in #39 is the part that fixes this issue.
Thanks
#43
I just fixed it in a simpler way. The module in #40 removed the parent class and changed some other things as I remember(hard to review since it was not in a patch).
#44
Automatically closed -- issue fixed for 2 weeks with no activity.