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;
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | news.sql_.zip | 1.42 KB | grasmash |
Comments
Comment #1
cspbm commentedI have the same issue. Any luck with this?
Comment #2
cspbm commentedUpgrade your Views - that worked for me :)
Comment #3
xarbot commentedI have the same issue and i install the last version of views
Thanks in advanced
Xarbot
Comment #4
boztek commentedI'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?
Comment #5
jeni_dc commentedI 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.
Comment #6
mikeryanThis 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)?
Comment #7
grasmash commentedI'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!
Comment #8
grasmash commentedNevermind, I figured out the problem. Had to set a column as the primary key for it to work. Thanks anyway!
Comment #9
mikeryan