After upgrading form beta5-6, I get an error "user warning: 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 'AND n.type = 'image' AND n.status = 1 ORDER BY n.sticky DESC, n.created ASC LIMI' at line 1 query: SELECT n.nid from node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid = AND n.type = 'image' AND n.status = 1 ORDER BY n.sticky DESC, n.created ASC LIMIT 0, 1 in /sites/all/modules/image/contrib/image_gallery/views/image_gallery_handler_field_gallery_cover.inc on line 164."

when trying to just add the field "Image gallery: Latest image-The most recently posted image in the gallery or its child galleries" to the view. thoughts?

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this.

Did you change the settings for that field?

joachim’s picture

Title: After upgrading from beta 5-6 get error user warning: You have an error in your SQL syntax; check the manual that corresponds to » SQL error in image gallery view

Better title.

Marked #922516: Error trying to display image in a view as a duplicate.

I still can't reproduce this. I need to know exactly what settings have been changed and fields added to the view -- and to *which* one, as there are *two* views involved in making galleries.

pixelsweatshop’s picture

Sorry for not providing more info. Here is an export of the view...

$view = new view;
$view->name = 'image_gallery';
$view->description = 'The default gallery of image nodes from Image gallery module.';
$view->tag = 'image_gallery';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'image_image' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'image_derivative' => 'thumbnail',
    'exclude' => 0,
    'id' => 'image_image',
    'table' => 'node',
    'field' => 'image_image',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
  ),
  'changed' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'changed',
    'table' => 'node',
    'field' => 'changed',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'null' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'must_not_be' => 0,
    'id' => 'null',
    'table' => 'views',
    'field' => 'null',
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => 'tid',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'image' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'image_size' => array(
      '_original' => '_original',
      'thumbnail' => 'thumbnail',
      'preview' => 'preview',
    ),
    'validate_argument_php' => '',
  ),
  'tid' => array(
    'default_action' => 'empty',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '%2',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'numeric',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'set_breadcrumb' => 1,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'image' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 1,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => 'uid',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'image_size' => array(
      '_original' => '_original',
      'thumbnail' => 'thumbnail',
      'preview' => 'preview',
    ),
    'validate_argument_php' => '',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'image' => 'image',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Image galleries');
$handler->override_option('empty', 'There are no images in this gallery.');
$handler->override_option('empty_format', '2');
$handler->override_option('items_per_page', 4);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'image_image' => 'image_image',
    'title' => 'title',
  ),
  'info' => array(
    'image_image' => array(
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
));
$handler = $view->new_display('image_gallery', 'Gallery page', 'image_gallery_1');
$handler->override_option('path', 'image');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
joachim’s picture

That doesn't look like it's been changed much if at all to me. And it produces no errors.

As I said, there are *two* views involved in making galleries -- perhaps you've exported the wrong one?

pixelsweatshop’s picture

I have disabled, uninstalled and then reinstalled it (for a second time), and everything is working fine now. Thanks for your prompt help. Keep up the good work. I really appreciate what you are doing.

pixelsweatshop’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Sorry. forgot to close.