Mini-browsers always show the number of results, even if pagination isn't enabled

Created on 18 March 2025, 15 days ago

Problem/Motivation

If you place a mini-browser block somewhere and disable pagination, you'll still see the result count displayed above the projects. This is intrusive and kinda dumb; if pagination is disabled, you can see all the projects right there.

Proposed resolution

If pagination is disabled, don't show the result count in a mini-browser. This is one-line fix in ProjectBrowser.svelte:

          {#if rowsCount}

needs to be:

          {#if rowsCount && paginate}
🐛 Bug report
Status

Active

Version

2.0

Component

User experience

Created by

🇺🇸United States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • 🇺🇸United States ijf8090
  • 🇺🇸United States matthewsmith619

    I am working on this as part of #Atlanta2025

  • 🇮🇪Ireland lostcarpark

    Steps to reproduce:

    1. Install Drupal and Project Browser module.
    2. Go to "Structure->Block Layout"
    3. Find the "Content" block and select "Place Block"
    4. Scroll down the list of blocks and find "Contrib Modules" and "Recipes" in the Project Browser category
    5. Click "Place block" button next to "Recipes"
    6. In the block settings, uncheck "Pagination", then save
    7. Go to front page of site and view mini browser block

    The browser will show "12 results" above the list of recipes

  • Merge request !787Updated the if statement → (Open) created by Unnamed author
  • 🇺🇸United States tim.plunkett Philadelphia

    There's a test for pagination across multiple project browser instances that *should* be able to test this too.

    Look for \Drupal\Tests\project_browser\FunctionalJavascript\MultipleInstancesTest::testIndependentPagination()

  • 🇮🇪Ireland lostcarpark

    I think the Tim's suggestion seems overkill for this, and I don't think a FunctionalJavascript test is required.

    My thinking is the test should place a block with pagination enabled, and verify the result count is displayed. Then edit the block, disable pagination, and verify result count not shown.

    There are some existing Functional tests in the file ProjectBrowserBlockTest.php that should be very similar, and it should be very straightforward to add a very similar test.

Production build 0.71.5 2024