WIP: No Result Breaks the Loop

Summary

When there are no results found in the loop, the page enters a broken state if the reset button is clicked. This bug is almost invisible as there are no console errors or log entries, but it disrupts the display of content including links, buttons, and images.

How to Observe

  1. Set up a scenario where no results are found in the loop.
  2. On my demo site, I have created a selection with three options on the homepage to force a result that does not exist and a submit button on the results page.
  3. In results page I have included a reset button, active filters, and a no result template.
  4. Click the reset button when no results are found.
  5. Notice the page enters a strange state, but refreshing the page with Ctrl+R or F5 restores normal functionality.

See the video

Observations

  • No console errors or log entries are generated.
  • The loop breaks and content like links, buttons, and images are not displayed correctly.
  • This issue is reproducible with any content, including simple images.

Initial Troubleshooting

  • Logically I have Checked the reset button settings to ensure page reload if reset, before noticing that this option does not exist …but in jetsmartfilers. this can help reload the page directly and avoid the bug, but this is not a fix it is a detail and a missing function to reset, adding it would be appreciated

  • So Logically I have Considered adding a button to link directly to the results page to mimic a reload page and hide unnecessary elements in a no result case. So I Looked for an option in Interactions to find if “No result” trigger but did not find this scenario supported.

Impact

This bug exposes a missing mechanism for handling no results or errors during filtering, affecting the user experience.

Requested Action

  • Investigate and fix the issue causing the loop to break when there are no results and the reset button is clicked.
  • Implement a mechanism to handle no result cases gracefully, ensuring the page and all content elements function correctly.

Adding a “Reload Page” setting in the reset button and a new trigger interaction for “Filters No Result” would be welcome additions. These enhancements would make filters easier to use in everyday life, complementing the efforts of this topic.

Thank you for your attention to this issue. Your prompt resolution and updates would be greatly appreciated.

Hello,

thank you for your report. I’ve tested locally, I’ve created a query loop and filters, and filtered the page to be empty. Then I reset the filters, and for me, it was working.

Now, the video you posted it not available anymore, so would it be possible to reupload it, to see how you have the structure and all settings?

Thank you,
Matej

Hi @Matej ,

Ah, I see what you did. It’s normal that the bug doesn’t exist in this form. You conducted the test in Scenario 2 where the bug doesn’t appear (quantum effect!?). To help catch this strange bug, I have created two videos:

Link here

  • Scenario 1: Bug if submitting results to the filters page
  • Scenario 2: No Bug if already on the filters page

I have put the videos in a drive folder. This way, they will remain accessible for a more in-depth study of this phenomenon.

Please try to replicate Scenario 1, as this is where the (quantum bug) is observable.

In Scenario 2, I had to modify my parameters on submit and insert an apply button test. In this case, you were not able to observe the bug. Otherwise, it is almost impossible to get a no result since the results are filtered according to the available choices in input.

I should mention that this bug has existed for as long as I can remember using filters under Bricks. I observed it in the past but did not report it, thinking that I was either mistaken or did not know how to use the filters properly.

Let’s hope that this quantum bug will be observable on your side and can be eradicated with fixes.

Edit :

Just in case, I made a 3rd observation

  • Scenario 3: No Bug taxonomy link to filters

do you remember this code?

/**
 * This code snippet modifies term links for various property-related taxonomies.
 * It redirects these links to a custom archive page with prefilters applied based on the term slug.
 * The taxonomies handled include property status, category, type, feature, and city.
 */

// Add a filter to modify term links
add_filter('term_link', function ($termlink, $term, $taxonomy) {
    // Define the base URL for the custom term links
    $base_url = trailingslashit(get_home_url()) . 'filters/?';

    // Check the taxonomy and modify the term link accordingly
    if ('property-status' == $taxonomy) {
        // If the taxonomy is 'property-status', append the status parameter to the base URL
        $termlink = $base_url . '_pstatus=' . $term->slug;
    } elseif ('property-category' == $taxonomy) {
        // If the taxonomy is 'property-category', append the category parameter to the base URL
        $termlink = $base_url . '_pategory=' . $term->slug;
    } elseif ('property-type' == $taxonomy) {
        // If the taxonomy is 'property-type', append the type parameter to the base URL
        $termlink = $base_url . '_ptype=' . $term->slug;
    } elseif ('property-feature' == $taxonomy) {
        // If the taxonomy is 'property-feature', append the feature parameter to the base URL
        $termlink = $base_url . '_pamenities=' . $term->slug;
    } elseif ('property-city' == $taxonomy) {
        // If the taxonomy is 'property-city', append the city parameter to the base URL
        $termlink = $base_url . '_pcity=' . $term->slug;
    }

    // Return the modified term link
    return $termlink;
}, 10, 3);

no …? but yes, you’ve already seen it here
so we’ll try to see if we still have an error… and no!
it doesn’t exist in this form, yet there’s every chance that it will happen but it goes well

so I think the fact that sending the results from Filter - Submit / Reset > Redirect to causes something that makes reset bug

Hi @neosan,

sorry for the late reply! I was away last week.

I’ve tested this and I was unable to reproduce this bug, even with Scenario #1. Even if I land on the page, where I don’t have any results, and I click “reset filters”, I still see images and I can open a popup with interactions, for example.

Can you send temporary login credentials to your test/staging website and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase, so we can take a look, why is happening in your case?

Thanks.
Matej

hi @Matej

I am on localwp and during these last days the bug disappeared then reappeared several times,
so I decided to clean my installation and redo a basic ultra default clean install named “test” with all the recent parameters available (see localwp config in the video) , with localwp in a confined and controlled environment, if you have the possibility to use localwp you will have the same result

  • Latest localwp available 9.1.0+6719
  • Fresh WordPress 6.7
  • Bricks 1.11.1
  • ACF Pro (for the gallery, you can also use Pods Gallery as it’s the same )

Despite following the standard default settings, the bug persists. I have captured the issue in a video where you can follow my actions step-by-step.

Here’s what I’ve done so far:

  1. Razed everything and did a ultra clean install.
  2. Installed only Bricks 1.11.1 and ACF Pro.
  3. Created random posts with random tags and catagory for filters
  4. add some images in gallery fields
  5. Placed a carousel within a loop (I suspect this is where the issue arises).

here the video

Nothing special—you install it quickly and redo the same basic manipulations. Make sure to follow what you see and especially place a carousel in the loop. You really have to see it for yourself to diagnose the issue. I formatted my old installation as it became too random.

I even reset my Edge browser (Version 130.0.2849.80) and deleted all my add-ons, but that didn’t change anything.
image

Hi,

thank you. I’ve identified the issue and I’ve created an internal task for this. We will update this topic once the fix is released.

Matej