The old handbook entry on how to make the A/B/C view (http://drupal.org/node/74715) has the following link: http://www.elderweb.com/home/sitemap/A

If you check out that link you see the exact same thing I am seeing on my Drupal site. I am trying to use the Summary + full view feature and I get a letter for each node that is in a particular term. So, if I have three nodes in one term, and that term starts with B, then I get B (1) | B (1) | B (1) instead of B (3)

I got this behavior on 5.x-1.0 and 5.x-1.x-dev. In fact, in the dev version I got B (1) || B (1) || B (1)

Comments

karens’s picture

I think this was broken in the latest version of Views. See my comments at http://drupal.org/node/134375 for a suggested fix that will get this working right again.

karens’s picture

Status: Active » Fixed

Fix this by opening your view to edit it and going to the Arguments section. There you need to change anything that has 'Summary, sorted as view' to 'Summary, sorted ascending'. I'm going to make this fix in the handbook page, too.

Anonymous’s picture

Status: Fixed » Closed (fixed)
crbassett’s picture

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

&I made the suggested change, and it fixed half of the problem.

My first problem was if I had say, two nodes in the "Apple; category and one in the "Aardvark" category, I got the following alpha list:

A (1) | A (1) | A (1)

Now, I get A (2) | A (1). That is, I am still not getting true alpha paging. I can't get what the example says on the project page:

A (10) | B (33) | C (4) | ...
-------------------------------
Accessiblility (5)
Action (2)
Assistance (3)

The example on the project page would look like this on my site:

A (5) | A (2) | A (3) | B (33) | C (4) | ...
-------------------------------
Accessiblility (5)
Action (2)
Assistance (3)

Am I missing something? Should I just use 4.7.6? Currently I am using the latest Drupal core and View and View Bonus pack modules...I installed the site fresh this morning.

csc4’s picture

Priority: Normal » Critical

I have the same problem and have had since April - I'm trying to launch three sites and can't until this is fixed. I'm totally confused about which version of Views and Views Bonus are supposed to be used so this works.

I have sorted the views ascending but the built in taxonomy directory and my view both show things like:
* A (1) | * A (1) | * C (1) | * C (1) | * C (1) | * C (1) | * D (1) | * D (1) | * E (1) | * E (1) | which is just hopeless.

If it was a change to views which broke this couldn't it be backed out - or we be told a 'safe' version of views to use? It has been broken for me for about two months and I think I've tried just about every combination of versions. HELP please!

csc4’s picture

Title: Duplicate Letters on » Duplicate Letters on summary A/B/C listings
Status: Postponed (maintainer needs more info) » Active

Could really use some help here - this is an absolutely critical problem with Summary Views

emmajane’s picture

This also does not work for me: http://gbcn.ca/directory

Perhaps it's a problem with the view settings? Pasted here for your reference:

  $view = new stdClass();
  $view->name = 'taxonomy_directory';
  $view->description = 'First letter of term on top and related view on bottom of each page.';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'directory';
  $view->page_header = '';
  $view->page_header_format = '3';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'summary_combo';
  $view->url = 'directory';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '50';
  $view->menu = TRUE;
  $view->menu_title = 'Directory';
  $view->menu_tab = FALSE;
  $view->menu_tab_weight = '0';
  $view->menu_tab_default = FALSE;
  $view->menu_tab_default_parent = NULL;
  $view->menu_tab_default_parent_type = 'tab';
  $view->menu_parent_tab_weight = '0';
  $view->menu_parent_title = '';
  $view->sort = array (
    array (
      'tablename' => 'term_data',
      'field' => 'weight',
      'sortorder' => 'ASC',
      'options' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'sticky',
      'sortorder' => 'DESC',
      'options' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
    array (
      'type' => 'taxletter',
      'argdefault' => '4',
      'title' => '%1',
      'options' => '1',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
    array (
      'type' => 'taxletter',
      'argdefault' => '4',
      'title' => '%2',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(term_data, node);
  $views[$view->name] = $view;
emmajane’s picture

This also does not work for me: http://gbcn.ca/directory

Perhaps it's a problem with the view settings? Pasted here for your reference:

  $view = new stdClass();
  $view->name = 'taxonomy_directory';
  $view->description = 'First letter of term on top and related view on bottom of each page.';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'directory';
  $view->page_header = '';
  $view->page_header_format = '3';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'summary_combo';
  $view->url = 'directory';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '50';
  $view->menu = TRUE;
  $view->menu_title = 'Directory';
  $view->menu_tab = FALSE;
  $view->menu_tab_weight = '0';
  $view->menu_tab_default = FALSE;
  $view->menu_tab_default_parent = NULL;
  $view->menu_tab_default_parent_type = 'tab';
  $view->menu_parent_tab_weight = '0';
  $view->menu_parent_title = '';
  $view->sort = array (
    array (
      'tablename' => 'term_data',
      'field' => 'weight',
      'sortorder' => 'ASC',
      'options' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'sticky',
      'sortorder' => 'DESC',
      'options' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
    array (
      'type' => 'taxletter',
      'argdefault' => '4',
      'title' => '%1',
      'options' => '1',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
    array (
      'type' => 'taxletter',
      'argdefault' => '4',
      'title' => '%2',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(term_data, node);
  $views[$view->name] = $view;
dmitrig01’s picture

Project: Views Bonus Pack » Views (for Drupal 7)

this is a bug in views module, not views_bonus

csc4’s picture

If it's a known bug does that mean there's a known fix? I've been reporting this for some time - and have already had to delay a site launch as there appears to be no fix and no workaround. It's manifesting on Drupal 5 sites all over the place (including elderweb)... if someone knows the answer - @dmitrig01? - then please share it as I have no working summary listings at all.

Thomas Sewell’s picture

Would someone having this problem test to see if the problem occurs on their site when they are logged in as user 1? Just double-checking to see if this is the same issue as http://drupal.org/node/157453 or a different issue. If it's the same issue, it may be permissions related somehow.

csc4’s picture

Sadly I'm almost always logged in as user 1 so I don't think that's the issue for me at least - but I'm convinced that you're right and the issue is that distinct is being introduced erroneously.

I've been trying to understand this for months but my core knowledge isn't quite strong enough - better than it was two months ago now though!

The advice regarding the db_rewrite_sql issues usually suggest adding brackets around the where clause in order to make sure the distinct is applied only where it should. I know this solved it for me with my own custom blocks which were exhibiting very similar errors but I have no idea how to go about putting this right for the entire view module!

I also think there are two different things going on - the first one is the default views sort order must have changed requiring the sort ascending workaround, the second is something to do with the distinct clause. I'm surprised this doesn't seem to be a higher priority considering it's breaking out of the box installs and demo pages for views related modules! I'm trying to launch my first drupal project and my client is not impressed that I haven't been able to solve this since April.

crbassett’s picture

I also get this problem logged in as user 1. I too have a couple sites that desperately need this functionality. Unfortunately, I am not a coder, so this is hard for me to figure out.

crbassett’s picture

Forgive me for my questions. I'm just wondering how "deep" of a problem this is. Since I don't understand the ins and outs of PHP it is hard for me to gauge things.

Anyway, is there anyone looking into this? What kind of cash bounty would it take to get this done? I have limited resources, but it is getting to the point where I might need to offer some $$ to get it fixed. There are others who've posted here about needing this fixed before they launch some websites. Would they be interested in chipping in some $$ to get this done?

merlinofchaos’s picture

Status: Active » Fixed

Okay, figured out this problem. To summarize:

For Postgres compatibility, whenever an ORDER BY is added to the query, that order by MUST ALSO be in the select.

In the case of summaries by taxonomy title, when using letters, what we were ORDERing on didn't exactly match what was in the select, so it added it again. Which means the summary was completely breaking because it was trying to group on full terms. This, obviously, failed hideously, giving the result you see here. This actually turns out to be a very different bug than what I thought it was, which is part of why this took so long to track down and fix.

Fix committed to HEAD. New release rolled soon.

crbassett’s picture

Thanks so much. I'll be testing it on Tuesday, July 17th. I'll post here with results.

csc4’s picture

This is brilliant news - thanks for persevering with this.

Thanks.

crbassett’s picture

I've tested the HEAD version and it works correctly as you say. Thank you very much for the work. I truly appreciate it.

Anonymous’s picture

Status: Fixed » Closed (fixed)
druvision’s picture

No longer needed to install HEAD.

The combination of Views Bonus 5.x-1.2-alpha1 + Views 5.x-1.6.5 does it out of the box

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

bsuttis’s picture

I'm still getting this problem on a fresh install of 5.2, with Views 5.x-1.6 and the latest Views Bonus.

rimma’s picture

just follow up this issue.

bsuttis’s picture

I think I understand why it wasn't working for me, I've been trying to use this with an argument of Node:Title (with option set to 1) with absolutely no luck.

As soon as I change the argument to Taxonomy:Term Name, all works as it should. The problem is, I want this sorting functionality for my node titles, I don't want to have to tag each node. Is this not able to work with Node:Title as the argument?

bsuttis’s picture

Ack, ignore what I said above.

It seems to be working for me now.