Trying to build an views-imagefield-imagecache-lightbox gallery there is some issues that I cannot figure out
starting with this simple & nice example: http://raincitystudios.com/blogs-and-pods/hubert/a-simple-ajax-image-gal...

A CCK content type with 2 imagefields inside
20+ images uploaded per cck node

The problem using this approach is that paging is not possible (viewable) using per node imagefield gallery view with the argument: Node ID from URL
View displays (imagecached) images ok, even lightbox can see all images after the pager limit (e.g 10) if grouped in views. Still "gallery" view has NO PAGER

Has "views pager" been implemented in individual single node cck fields (like imagefields)? or only between different nodes? ( pager there is ... ok)
Any help appreciated... hoping I'm wrong and forgot something else or I'm bugged

CommentFileSizeAuthor
#7 Edit view sx2 - acl-viewsbug_post1.jpg63.74 KBjannalexx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

The key word here is 'grouped'. If together then they are all a single record, so there is no pager. You need to not group them in this case.

jannalexx’s picture

I see, but no groupings produce the same no pager situation. Tested that also. It is probably something else.
I will try to see if a new clean cck node type / imagefield can solve this or try a new installation. thanks

jannalexx’s picture

still no luck, same issue with any cck field (not only images)

i managed to get this working in an other older drupal version site, so it is supposed to work and thats ok & easy.
Here things are getting complicated and I try to figure out what can bring such a conflict.
tried to unload almost all modules
tried to reinstall views (tried 2.1, 2.2, dev2.x)
tried other content types
tried other themes
nothing... !
Same view export is working in the other site!
Any ideas? Has anyone experienced such a conflict? Is there a way to track this behaviour somehow an give u more details? thanks

jannalexx’s picture

Issue tags: +ACL

Its a deeper bug,
The ACL module, which stands for Access Control List http://drupal.org/project/acl,
forces views not to use the pager in some special cases like this one

maybe other side effects live there also. Please consider (posted also on ACL issues http://drupal.org/node/367761)

choster’s picture

Status: Active » Closed (fixed)

Since #367761: incopatibility with views 2 (missing pager) is an ACL issue, I think it's safe to close the Views issue.

merlinofchaos’s picture

I'm confused. That issue is posted by the same person and contains absolutely no information. I have no idea what's going on here, but we're throwing blame left and right without throwing evidence and it makes me uncomfortable.

jannalexx’s picture

Status: Active » Closed (fixed)
Issue tags: +ACL
FileSize
63.74 KB

intension is to prevent others from breaking their views!.. no confusions. I reproduced the issue in a clean installation so I can now give u details

clean install drupal 6.9
install views latest 2.2
install acl (beta3, beta4) and recreate access permissions as pointed

Make a post in node 1 with some comments (more than 2)
try a view like this one:

$view = new view;
$view->name = 'sx2';
$view->description = 'view-acl bug';
$view->tag = 'comgallery';
$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(
  'status' => array(
    'label' => 'pub',
    'type' => 'yes-no',
    'not' => 0,
    'exclude' => 0,
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'title1',
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'type' => array(
    'label' => 'type1',
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'subject' => array(
    'label' => 'commtitle1',
    'link_to_comment' => 1,
    'exclude' => 0,
    'id' => 'subject',
    'table' => 'comments',
    'field' => 'subject',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'nid' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'ol',
    'title' => '',
    'default_argument_type' => 'node',
    'default_argument' => '',
    'validate_type' => 'node',
    'validate_fail' => 'not found',
    'break_phrase' => 1,
    'not' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'page' => 'page',
      'story' => 'story',
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(),
    'validate_argument_type' => 'tid',
    'validate_argument_php' => '',
    'override' => array(
      'button' => 'Override',
    ),
    'validate_argument_is_member' => 0,
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('title', 'testing acl-views bug');
$handler->override_option('empty', 'nothing here');
$handler->override_option('empty_format', '1');
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 2);
$handler->override_option('use_pager', '1');
$handler->override_option('pager_element', 1);
$handler->override_option('use_more', 1);
$handler->override_option('distinct', 0);
$handler->override_option('style_options', array(
  'grouping' => '',
));
$handler->override_option('row_options', array(
  'inline' => array(
    'field_photo_perioxes_fid' => 'field_photo_perioxes_fid',
  ),
  'separator' => '',
));
$handler = $view->new_display('block', 'Μπλοκ', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('page', 'Σελίδα', 'page_1');
$handler->override_option('path', 'photocollection');
$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,
));

.. find the pager..

salvis’s picture

Status: Closed (fixed) » Active

@merlinofchaos: We've found out in #367761: incopatibility with views 2 (missing pager) that enabling Content Access (instead of ACL) will produce the same issue. So it looks like a problem with db_rewrite_sql() — back to you...

@jannalexx: What database are you using? Maybe this provides a clue...

salvis’s picture

Issue tags: -ACL
jannalexx’s picture

mySQL 5, utf8. please if someone reproduced the issue, inform us.. so we can confirm. Let me know if you need further details.
You can also change the title here, final clue has to do with every field not only an imagefield as first stated

merlinofchaos’s picture

If the problem is with db_rewrite_sql() then you probably need to find the query as it's supposed to be and how it's getting rewritten incorrectly. My guess is that something is causing the COUNT query to not work quite right.

I can't easily duplicate this, though, and if the problem is in db_rewrite_sql I have very little motivation to chase it down as that's outside of Views and I've got enough to do here.

jannalexx’s picture

thanks for all anyway,
if anyone finds the time.. this can be duplicated easily, it cant be my imagination,
if someone use those permission access modules please try and verify, at the time being i will experiment other possible solutions, and maybe I will come with a clue.

it affects all views with per node "Node ID from URL" fields cck and core, if it is an ACL or Content Access db_rewrite_sql() anomaly with core then I will have to pray and try other permission modules, good luck with all your work

jannalexx’s picture

More info. modules Taxonomy Access Control Lite http://drupal.org/project/tac_lite
and Taxonomy Access Control http://drupal.org/project/taxonomy_access
same behavior after rebuilding permissions

jannalexx’s picture

Status: Closed (fixed) » Active
Issue tags: -ACL

experimental solution..
Using the option distinct I get this 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 'DISTINCT(node.nid), node_data_field_photo_perioxes.field_photo_perioxes_fid A' at line 1 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node_data_field_photo_perioxes.field_photo_perioxes_fid AS node_data_field_photo_perioxes_field_photo_perioxes_fid, node_data_field_photo_perioxes.field_photo_perioxes_list AS node_data_field_photo_perioxes_field_photo_perioxes_list, node_data_field_photo_perioxes.field_photo_perioxes_data AS node_data_field_photo_perioxes_field_photo_perioxes_data, node_data_field_photo_perioxes.nid AS node_data_field_photo_perioxes_nid, node_data_field_photo_perioxes.delta AS node_data_field_photo_perioxes_delta, node.type AS node_type, node.vid AS node_vid, node.title AS node_title FROM drupal_node node LEFT JOIN drupal_content_field_photo_perioxes node_data_field_photo_perioxes ON node.vid = node_data_field_photo_perioxes.vid WHERE (node.status <> 0 OR node.uid = 1 or 1 = 1) AND (node.status <> 0) AND (node.type in ('infotravel')) AND (node.nid = 10) ) count_alias in ...\sites\all\modules\views\includes\view.inc on line 705.
# 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 'DISTINCT(node.nid), node_data_field_photo_perioxes.field_photo_perioxes_fid A' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node_data_field_photo_perioxes.field_photo_perioxes_fid AS node_data_field_photo_perioxes_field_photo_perioxes_fid, node_data_field_photo_perioxes.field_photo_perioxes_list AS node_data_field_photo_perioxes_field_photo_perioxes_list, node_data_field_photo_perioxes.field_photo_perioxes_data AS node_data_field_photo_perioxes_field_photo_perioxes_data, node_data_field_photo_perioxes.nid AS node_data_field_photo_perioxes_nid, node_data_field_photo_perioxes.delta AS node_data_field_photo_perioxes_delta, node.type AS node_type, node.vid AS node_vid, node.title AS node_title FROM drupal_node node LEFT JOIN drupal_content_field_photo_perioxes node_data_field_photo_perioxes ON node.vid = node_data_field_photo_perioxes.vid WHERE (node.status <> 0 OR node.uid = 1 or 1 = 1) AND (node.status <> 0) AND (node.type in ('infotravel')) AND (node.nid = 10) LIMIT 0, 10 in ...\sites\all\modules\views\includes\view.inc on line 731.

after core patch in database.mysqli.inc file from http://drupal.org/node/284392#comment-1049183
db_rewrite_sql causing issues with DISTINCT
my views work with pager and access modules enabled! (but only with distinct option!)

there is also some issues related with access modules in this thread like this one

what do you think of that? at least I have a working solution but I need your point of ..view(s)

neurer’s picture

Same issue here: Trying to build a gallery with identical setup (except Views 2.3 and Thickbox) and module config. Setting distinct to YES also gives me 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 'DISTINCT(node.nid) [...] I'll try to apply the solution jannalexx mentioned at #14 and report back within a day.

neurer’s picture

Works. Applied the patch @ http://drupal.org/node/284392#comment-1049183 and set distinct to YES. Pager now shows up. Any chance of getting this fixed, without patching CORE?

jannalexx’s picture

note that this is general on fields accessible by views, not only cck or imagefield related

gmclelland’s picture

For any one else who has this problem... I turned off the Organic Groups Access Control Module, then the pager appeared and the tutorial worked for me.

Hope that helps someone.

Anonymous’s picture

Tested this and found the same bug, with all latest version of modules and Drupal. Pager is missing.

Anonymous’s picture

Category: support » bug
merlinofchaos’s picture

Status: Active » Closed (won't fix)

If the patch against core mentioned in #16 fixes this, there's not much point in marking this as a bug against Views...

(To answer another question, no, that bug cannot be fixed from within Views).