Hi,
I created a new view in d7 which was a block and tried to save it without making any additional changes to it but I got the below error. I have attached the screenshot for more information.

"Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'FROM
node node
LIMIT 5 OFFSET 0\' at line 1'"

I did a search and could not find any relevant information. Please let me know if I need to provide any additional information about this problem.

cheers,
Vishal

CommentFileSizeAuthor
#3 Screenshot-1.png106.22 KBvishalkhialani
Screenshot.png143.12 KBvishalkhialani

Comments

vishalkhialani’s picture

My server Details:

Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $
PHP extension: mysql

neoglez’s picture

Status: Active » Postponed (maintainer needs more info)

I just tryed the following cases:

  1. Create a View (default) and then a display as a block -> works!
  2. Create a View as a Block (without a page display), this should be your case -> works!

Please, make sure you follow this instructions http://drupal.org/project/views
Here is a view you can try:

$view = new view;
$view->name = 'issue1136196_1';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Issue1136196_1';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Issue1136196_1';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$translatables['issue1136196_1'] = array(
  t('Master'),
  t('Issue1136196_1'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('Block'),
);
vishalkhialani’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new106.22 KB

Hi,
I tried to import yours but I got the below error. I read the documentation which you provided but did not find anything useful.

Field handler node.title is not available.
Sort criterion handler node.created is not available.
Filter criterion handler node.status is not available.
Field handler node.title is not available.
Sort criterion handler node.created is not available.
Filter criterion handler node.status is not available.
Unable to import view.

Cheers,
Vishal

neoglez’s picture

This is the part a ment:

When installing Views on Drupal 7, you absolutely must have CTools of at least alpha4 and you may need to flush cache as much as twice. There are currently issues with core's cache flushing that means one cache flush isn't necessarily enough. Also, if your CTools' version is older than CTools 7.x-1.0-alpha4 things will crash a lot..

These (field, filter & sort) handlers (the ones in your picture) are Views' default handlers and they MUST be avalaible, only if they weren't loaded (let's say becouse they wouldn't be included in the .info file) then things could fail.
So, check again:
ctools alpha4.
Views 7.x-3.x-dev (2011-Apr-23)
Flush cache as much as twice (or even once more).
The problem is the error can not be reproduced.

neoglez’s picture

Status: Active » Postponed (maintainer needs more info)
dawehner’s picture

Did you managed to disable the node module?

vishalkhialani’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hi,
Its working now :)

I guess the problem was ctools needed an update and a lot of tries of clearing the cache.

Cheers,
Vishal

Status: Fixed » Closed (fixed)

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

bajah’s picture

Title: Unable to save a view » Unable to delete a view
Version: 7.x-3.x-dev » 7.x-3.0-rc1
Component: Code » Views Form
Assigned: Unassigned » bajah
Status: Closed (fixed) » Active

Im having the same problem but this time is when im trying to delete a view

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

What did you to fix the issue?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)