I get this error if I try to export a CSV file using batch mode.

user warning: Table 'bn.views_data_export_index_14' doesn't exist query: SELECT COUNT(*) FROM views_data_export_index_14 in /var/www/bn/bn/sites/all/modules/views_data_export/plugins/views_data_export_plugin_display_export.inc on line 216.

views_data_export_plugin_query_default_batched::execute() seems to not to be creating the table the first time through? I've stepped through the code and $view->build_info['query'] is empty, and so the create table never gets run.


  function execute(&$view) {
    $display_handler = &$view->display_handler;

    $external = FALSE; // Whether this query will run against an external database.
    $query = $view->build_info['query'];
    $query = $view->query;
    $count_query = $view->build_info['count_query'];
    $count_query = $view->count_query;
    if (empty($this->options['disable_sql_rewrite'])) {
      $query = db_rewrite_sql($view->query, $view->base_table, $view->base_field, array('view' => &$view));
      $count_query = db_rewrite_sql($view->build_info['count_query'], $view->base_table, $view->base_field, array('view' => &$view));
    }
    $args = $view->build_info['query_args'];

    vpr($query);

    $items = array();
    if ($query) {
        ...

Comments

ezeedub’s picture

Here's that function again without my debugging "fixes":

  function execute(&$view) {
    $display_handler = &$view->display_handler;

    $external = FALSE; // Whether this query will run against an external database.
    $query = $this->final_query;
    $count_query = $this->count_query;
    $args = $this->query_args;

    vpr($query);

    $items = array();
    $start = 0;
    if ($query) {
       ....
steven jones’s picture

Status: Active » Fixed

This is fixed in CVS (as of yesterday) but thanks for the report!

jamsilver’s picture

Yeah - this is due to the fact that, as we speak, the internals of views 3 is being changed, (it's still in alpha you see). It's quite likely that we'll see this issue in the 7.x branch soon - assuming the views guys will be making the same changes branch to the Drupal 7 version of views 3.

ezeedub’s picture

I figured you were all over it, but on the off chance I'd save you a couple seconds of looking, I thought I'd post.

Thanks for all you do!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jvdurme’s picture

Status: Closed (fixed) » Active

Using Views 6.x-3.x-dev and Views Data Export 6.x-2.0-beta5, but just ran into this issue. So putting it back to active.

user warning: Table 'devel.views_data_export_index_7' doesn't exist query: SELECT COUNT(*) FROM views_data_export_index_7 in /var/www/devel/sites/all/modules/contrib/views_data_export/plugins/views_data_export_plugin_display_export.inc on line 228.

The CSV file can be downloaded though.
I also have some exposed filters and it seems that no matter what filters I set, the CSV file always contains all data. Which is a bit silly.

EDIT: when I check "Parent sort" all these things get solved. Not sure why the error disappears now. Feel free to close it again if it works as it should. Oh, and I changed to non-batch mode. ;-)

tinefin’s picture

I was running the export via drush, same error.
Updated drush from 4.4 to 4.5 -fixed :)

steven jones’s picture

Status: Active » Closed (fixed)

Right, well you should be using VDE 6.x-2.x with views 6.x-2.x too, so marking as closed.

fonant’s picture

I'm getting this error with:

Views 6.x-3.0
Views Data Export 6.x-2.0-beta5

Upgrading to Views Data Export 6.x-3.0-beta5 removes the error, but my export is empty.

tanasi’s picture

Status: Closed (fixed) » Active

I was getting the same error with
Views 6.x-3.0 and
Views Data Export 6.x-2.0-beta5.
I Installed Views Data Export 6.x-3.0-beta5 which removed the error, the csv seems ok but with a .part extension. I had to rename the file to name.csv to get it work.
Also in the status report I can see the following with a red color:
Views data export 6.x-3.0-beta5
Recommended version: 6.x-3.0-beta5 (2011-Jul-01)
Can I remove this warning?

So, for us with the above configuration there is no hope of getting it working right?

steven jones’s picture

Status: Active » Closed (fixed)

Yup, read comment #8 and don't re-open issues without good reason please.

summit’s picture

Hi,
I see for Views 3 is Views Data Export 3 needed, but because 3.beta5 is not on homepage it is an obvious mistake to take 2.
So please also set 3.beta5 on homepage please.

EDIT: Views 3.dev latest version (sept-22-2012) with Views Data Export 3 (beta-5) gives still this error!
I can't go back to Views 2 because of other functionality and database changes, so how to proceed please?

Greetings, Martijn

steven jones’s picture

@Summit VDE 3 for Drupal 6 is not supported, which is why its not listed on the page.

summit’s picture

Hi @Steven thanks for your quick reply. How to proceed please while Views 3 itself is stable now, and Views 2 is not moving forward related to functionality?
Greetings, martijn

steven jones’s picture

Views 3 for Drupal 6 is not the recommended release according to the views project page. We don't have time to support three different versions of views.
I suggest that if you want to post patches for Views 3 on Drupal 6, then we'd apply them to the module.

summit’s picture

Hi,
I see Views2 is the recommended, but as you can see development moves on in Views 3: 6.x-3.x-dev tar.gz (1.1 MB) | zip (1.26 MB) 2012-Sep-22, while Views 2 is not touched from more than a year ago (2011-Nov-14).

I see there is a patch! Can you please commit this one to Beta5? http://drupal.org/files/views_data_export-3.0-beta-5_fix_sql_drop_table_...
EDIT: This issue for this patch is: http://drupal.org/node/1800276

Thanks a lot in advance!
Greetings, Martijn