Using Views 6.x-2.8

When I add an existing table, the table is added fine, but no view is created for it. When I "Export views definition for selected tables" and try to import a new view using the code it fails giving me "Unable to interpret view code."

Here is the code generated that I am trying to use as import code for Views:

$data = array();
$data['user_import'] = array(
'name' => array(
'title' => t('name'),
'help' => t('user_import.name'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'allow empty' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
),
'mail' => array(
'title' => t('mail'),
'help' => t('user_import.mail'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'allow empty' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
),
'fname' => array(
'title' => t('fname'),
'help' => t('user_import.fname'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'allow empty' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
),
'lname' => array(
'title' => t('lname'),
'help' => t('user_import.lname'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'allow empty' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
),
);
return $data;

CommentFileSizeAuthor
#7 news.sql_.zip1.42 KBgrasmash

Comments

cspbm’s picture

I have the same issue. Any luck with this?

cspbm’s picture

Upgrade your Views - that worked for me :)

xarbot’s picture

I have the same issue and i install the last version of views

Thanks in advanced

Xarbot

boztek’s picture

I'm experiencing the same problem.
Set a primary key in the database table and exported views code but it won't import, giving same "can not interpret" error message.

Is there a missing step?

jeni_dc’s picture

I was having the same problem, then saw that a view was created but didn't seem to be working. I disabled the view, and re-enabled it and it worked. Not sure why or how, but it did!

I did run cron manually to see if that made a difference when it wasn't working. I didn't check before and after running cron if the view was created on the view list page, but running cron could have done something.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

This works in general (for tables with single-column primary keys, of course), so there must be something specific about the table you're adding that's giving you trouble. Can you provide more info (like a SQL create statement for the table in question)?

grasmash’s picture

StatusFileSize
new1.42 KB

I'm experiencing the same exact issue with multiple tables (albeit all exported from the same database).

Ran cron and flushed caches. Tables wizard seems to import table but not generate view. Exporting views definitions and manually importing generates "Unable to interpret view code."

Attached is a dump of one of the tables.

using:
Table Wizard 6.x-1.2
Schema 6.x-1.7
Views 6.x-2.10
Migrate 6.x-1.0 (have really gotten to this step)

Please help! thanks!

grasmash’s picture

Nevermind, I figured out the problem. Had to set a column as the primary key for it to work. Thanks anyway!

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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