Bootstrap Tabs not aggregating or grouping

Created on 29 July 2024, 5 months ago

Problem/Motivation

I'm trying to update to Drupal 10.3.1. When I did this, it wouldn't allow my Views Bootstrap patch to go through which has been there for years. I had to remove it to update.

I'm using Views Bootstrap 5.5.0-beta4. I will try to attach a screenshot of what I see in my Bootstrap View using Tabs. Essentially, it's not aggregating. If I'm using a category for a tab, like "Cars", then I have 12 cars, it will show 12 tabs for Cars instead of one.

I vaguely remember there being a setting in a View or somewhere else that needs to be toggled, but please advise on what I need to do to get this running in production. I can't apply any patches I have found.

Gathering patches for dependencies. This might take a minute.
- Installing drupal/views_bootstrap (5.5.0-beta4): Extracting archive
- Applying patches for drupal/views_bootstrap
https://www.drupal.org/files/issues/2024-03-19/views-rows-content-groupe... β†’ (2948150: Views Bootstrap Tabs cannot be grouped)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2024-03-19/views-rows-content-groupe... β†’

In PluginManager.php(274) : eval()'d code line 331:

Cannot apply patch 2948150: Views Bootstrap Tabs cannot be grouped ( https://www.drupal.org/files/issues/2024-03-19/views-rows-content-groupe... β†’
2948150-49.patch)!

Steps to reproduce

Using Drupal 10.3.1 and Views Bootstrap 5.5.0-beta4, create a view showing some kind of content which is related to a taxonomy vocabulary. For me, it's Media and document types. I'm displaying files and the Tab is using a taxonomy term called Document Type.

πŸ› Bug report
Status

Active

Version

5.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rraney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    Can you screenshot your views settings too?

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Tab settings added, what would you like to see exactly?

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Is this the same problem I'm having?
    https://www.drupal.org/project/views_bootstrap/issues/2948150 ✨ Views Bootstrap Tabs cannot be grouped RTBC

    My production site currently works. We are using 5.5.0-alpha1 with Drupal 10.2.5. We have a patch "installed" using composer from the issue above.

    "drupal/views_bootstrap": {
    "2948150: Views Bootstrap Tabs cannot be grouped" : " https://www.drupal.org/files/issues/2024-03-19/views-rows-content-groupe... β†’ "
    }

    When I updated to 10.3.1, it wouldn't let me keep this patch. I'm wondering if this patch is necessary in order for tabs to be "grouped" or aggregated. Also, why is composer saying it cannot install the patch?

  • Status changed to Closed: works as designed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    That patch has already been applied and released in the beta1 release. Please update to the recently released 5.5.0-rc1

  • Status changed to Active 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I started out using the "beta" version of this module, then I switched back to alpha hoping it might work. I just ran this command:
    composer require 'drupal/views_bootstrap:^5.5@beta'

    I cleared cache, and the problem still exists. If you don't think it's a bug, then we can change to support request.

    Currently I'm running Drupal 10.3.1, PHP 8.1.x and this Version: 5.5.0-rc1, which was installed when I chose beta.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I'm attaching a screenshot of what I see in the View

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    This patch has a line that's added https://www.drupal.org/files/issues/2022-06-10/views-rows-content-grouped-by-tab-field-2948150-40.patch β†’
    like this, "+ $form['tab_group'] = [
    + '#type' => 'checkbox',
    + '#title' => $this->t('Group by tab field'),
    + '#default_value' => $this->options['tab_group'],
    + '#description' => $this->t('If you want to group tabs by same values.'),
    + ];"

    I cannot find this in the code here: /src/Plugin/views/style/ViewsBootstrapTab.php (which is installed in beta)

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I'm tempted to learn how to create my own patch, based on the old ones, because I need this to be working and the old patches don't work. Any suggestions appreciated!

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    The toggle "Group by tab field" is missing in the View form. I manually added it, however when I toggle to turn it "on", it does nothing. I'll have to look more closely at the code, but I think the update to the module is missing the form field and maybe something to make it work.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    In the theme.inc file, there is no $vars['tab_group'] = $view->style_plugin->options['tab_group'];
    I could go on and on, but it seems obvious this grouping code was not added to the version that was recommended to me.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Honestly, I think the template needs work. I could maybe try to help but there is no sign of a

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I believe I got it working locally. I'm not confident in how to make a patch. I basically worked around the existing code and used this patch to guide me. https://www.drupal.org/files/issues/2024-03-19/views-rows-content-grouped-by-tab-field-2948150-49.patch β†’

    Please let me know if there are plans to add the grouping code to the module, so I can do this the right way (the Drupal way).

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    I'll take another look today.

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    OK, so I followed commits made since that date. I removed that particular code in favor of using views grouping. I let views do the grouping logic rather than calculating it myself. Given that the module version was in alpha state at the time to allow for major changes, it comes with a bit of buyer beware when using an alpha version.

    As I said though, grouping is available, so let's walk through that.

    The view is set using fields and set to format as Bootstrap Tabs:

    The Bootstrap Tab settings select the field to use for grouping. In this test case, it's a taxonomy term value:

    Then the group field is displayed above the tabs that are grouped under that field:

    In your settings screenshot, that group field is not there and I'm not sure why. If you are still having difficulty, please reach out to me on Drupal Slack (shelane).

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Have you tested assigning the same grouping value to multiple pieces of content? I can't tell from the screenshot. All I know is I did everything you are showing and it didn't group. I selected a value to group by - shown in your second screenshot.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    If anyone could supply a patch for this version of the module, I'd appreciate it. I basically want the old version of the module that worked for me with the patch that supported grouping in tabs.

  • πŸ‡¦πŸ‡ΊAustralia noonoos

    Same issue here
    Drupal Version 10.3.2
    PHP 8.2
    Views Bootstrap 5.5.0-rc1

  • πŸ‡ΊπŸ‡ΈUnited States shelane
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    As per the related issue, I switched the type to feature request.

  • πŸ‡ΊπŸ‡ΈUnited States shelane
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Can you please share what I'm supposed to do if I would like to use the new merge request? Will it be part of an upcoming official release?

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    It will be part of an upcoming release. I have a few other tasks to finish before I make that release. You can use the dev version that includes the updates if you'd like.

    composer require 'drupal/views_bootstrap:5.5.x-dev@dev'

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

  • Status changed to Fixed about 8 hours ago
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I have the dev. version installed locally and I'm not getting the grouping option. I'll upload screenshots.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I would say this is not fixed.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I just realized there is a dropdown where you have to select to group, so I guess the dev. version DOES work. Please let me know when this will be released.

Production build 0.71.5 2024