Just upgraded after a few months

All views were broken till I did group by by the field I'd been using as tab field title, which as far as I can tell isn't being used anymore?

    $sets = $this->render_grouping($this->view->result, $this->options['grouping']);
    // Render each group separately and concatenate.  Plugins may override this
    // method if they wish some other way of handling grouping.
    $output = '';
    $this->view->row_index = 0;
    foreach ($sets as $title => $records) {
      $content = '';
      if ($this->uses_row_plugin()) {
                ...
        }
      } else {
        $rows = $records;
      }
      if (!$tabset[$title] && $this->uses_fields()) {
        $tabset[$title] = array(

$title is '' for non grouped.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hefox’s picture

Title: Non group by » Non group by tab titles broke in upgrade

oops

snufkin’s picture

Status: Active » Needs review
FileSize
2.14 KB

This fixed it for me, but use it with caution, I am not very familiar with the views API.

The issue was that title is not handled at all when using the row plugin instead of displaying nodes, moreover the content is concatenated instead of grouped under one title. Also removed the ambiguous selector option on the options, it was falling into the first if anyway because of the single '='.

jdwfly’s picture

Status: Needs review » Needs work

I am assuming you are using fields for the row style. The issue here is that the title of the tab needs to be configurable, but I was using the group by field for this purpose. And it does work in a way but it is probably not the best way to do it. That section really needs to be rewritten to include another setting that allows a person to chose which field should be the title of the tab. Someone may or may not want the title of the node as the title of the tab. I'll look into this over the next couple of days.

snufkin’s picture

I was using nodes for row style, because otherwise i could have on influence on the output (if i use rows the thumbnail slideshow doesn't use any theme overrides, so I can't inject any of my own processing there). What I wanted to achieve with my patch was to be able to use labels as the thumbnails, nothing more. The problem was that the module - as far I saw - does not implement content rendering per labels correctly if node view is used. With row style its all good though, it just didn't fit my use-case.

jdwfly’s picture

There are only two options for row style: node and fields. You go back and forth with different terms and it doesn't make any sense. What are you calling a label? Is that the title of the tab? You need to be more specific and use the correct terms otherwise I won't understand you.

jdwfly’s picture

Status: Needs work » Needs review
FileSize
2.17 KB

Somebody want to take this for a test drive before I commit it.

goldlilys’s picture

Tried this new patch and it still doesn't work properly as you can see here http://demo.goldlilys-media.com/singers.html . The tab label is coming from a taxonomy term which should group all singers that is tagged with that taxonomy. However, instead of grouping all singers under 1 term of same label, it creates a new tab label for each.

I tried using grouping together with the tab label for that taxonomy term, and it still doesn't work the way I want to.

Maybe you can take a look at how Views Accordion does their grouping. It should be similar to that since the only difference is the way it displays things (accordion vs tabs). As an example of the accordion and how it should group things similarly for tabs is http://demo.goldlilys-media.com/albums . Where all albums that is tagged with the taxonomy term is grouped under that in the accordion.

In views accordion, instead of having a separate "tab field", it uses the built in grouping field in Views Style options.

Hope you can fix this issue so I can start using this module when the site is live. Thanks.

jdwfly’s picture

FileSize
4.61 KB

So I finally got around to fixing this. Somebody want to take a look before I commit. I would suggest doing this on a test site because it will break any views you currently have. I've modified the code so that it should work as it should and I took out grouping.