Hi,

When I use the "Node export link" on my administrative view, I get this error :

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.node_revisions' doesn't exist

It prevents the view to display results, so this field/link is not usable for now.

This bug comes from :

sites\all\modules\node_export\views\views_handler_field_node_link_export.inc
Line 18

Cheers!

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

harley.orion’s picture

Hi,

I'm encountering the same issue and am not able to use the export link on views at all.

Using node_export 7.x-3.0. Same error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table '[databasename].node_revisions' doesn't exist

dolu, did you manage to find a solution on this?

ph7’s picture

Issue summary: View changes

node_revisions = D6
node_revision = D7

It's not just a matter of adding or renaming the table. Structures differ.

nessunluogo’s picture

I edited file node_export/views/views_handler_field_node_link_export.inc and this is working for me:

/**
 * @file
 * The Node export views field handler.
 */

/**
 * Field handler to present a export node link.
 *
 * Closely modeled after views/modules/node/views_handler_field_node_link_edit.inc
 */
class views_handler_field_node_link_export extends views_handler_field_node_link {
  function construct() {
    parent::construct();
    $this->additional_fields['nid'] = 'nid';  }

  function render($values) {
    // Insure that user has access to export this node.
    $node = new stdClass();
    $node->nid = $values->{$this->aliases['nid']};
    if (!node_export_access_export($node->nid)) {      return;    }
    $text = !empty($this->options['text']) ? $this->options['text'] : t('Node export');
    return l($text, "node/$node->nid/node_export", array('query' => drupal_get_destination()));
  }
}

Can someone test it?
Hope this helps!

nessunluogo’s picture

With #3 users without access get a notice for each node:

Notice: Trying to get property of non-object in node_export_access_export() (line 108 of sites/all/modules/contrib/node_export/node_export.module).

This depends from "is_int" check on line 99. It must be changed in "is_numeric".

function node_export_access_export($node) {
  global $user;
  if (is_numeric($node)) {
    $node = node_load($node);
  }
renzomb’s picture

FileSize
2.56 KB

This works for me too. I need this in a patch file so i created the patch

This patch its done with the edits of comments #3 and #4.
Is for the version 3.0

  • danielb committed 82d0ac5 on 7.x-3.x authored by renzomb
    Issue #2118451 by renzomb: SQLSTATE[42S02]: Base table or view not found...
danielb’s picture

Status: Active » Closed (fixed)