Crud: [4.0.7] select2_ajax filter breaks "Remove filters" button

Created on 8 Oct 2019  路  7Comments  路  Source: Laravel-Backpack/CRUD

Bug report

What I did

1 - Add a select2_ajax filter
2 - Filter the results
3 - Click in the "Remove filters" button

What I expected to happen

The filters should be removed

What happened

The filter is removed from the interface, but the list return zero results:

image

What I've already tried to fix it

What I can tell is that the filter key is still present when we remove the filter, but it has no value.

image

To avoid the empty results I added a check in the filter function:
image

Backpack, Laravel, PHP, DB version

PHP VERSION:

PHP 7.2.22 (cli) (built: Sep 8 2019 15:19:13) ( NTS )

LARAVEL VERSION:

laravel/framework v6.1.0

BACKPACK VERSION:

backpack/crud 4.0.7
backpack/generators 2.0.4
backpack/permissionmanager 5.0.1

WIP (Work in Progress)

Most helpful comment

:+1: Closing this as a solved issue :)

Thanks @jsvini and @prodixx for reporting it.

Wish you guys the best,
Pedro

All 7 comments

I'm facing the same problem. Maybe @tabacitu can give us a hint how to resolve it.

Hey @jsvini and @prodixx

I am so sorry but i could not replicate your issue, neither in online demo , neither in my local dev.

I get expected results when activating the filter and then clicking in Remove all filters .

### PHP VERSION:
PHP 7.2.18 (cli) (built: Apr 30 2019 23:39:01) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

### LARAVEL VERSION:
laravel/framework                     v6.5.1             The Laravel Framework.

### BACKPACK VERSION:
backpack/backupmanager                2.0.1              Admin interface for managing backups in Backpack, on Laravel 5.2+
backpack/crud                         4.0.16             Quickly build an admin interfaces using Laravel 6, CoreUI, Boostrap 4 and jQuery.
backpack/generators                   2.0.5              Generate files for laravel projects
backpack/logmanager                   3.0.0              An interface to preview, download and delete Laravel log files.
backpack/menucrud                     2.0.2              An admin panel for menu items, using Backpack\CRUD on Laravel 6.
backpack/newscrud                     3.0.0              An admin panel for news with categories and tags, using Backpack\CRUD on Laravel 5.
backpack/pagemanager                  2.0.2              Create admin panels for presentation websites on Laravel, using page templates and Back
backpack/permissionmanager            5.0.2              Users and permissions management interface for Laravel 5 using Backpack CRUD.
backpack/settings                     3.0.0              Application settings interface for Laravel 5 using Backpack CRUD.

Any error in console or in log files ?

Best,
Pedro

After i filter, let's say 'Trashed Items' and i clear the filter the items don't reappear in crud list.

Im getting theese errors in console:
Screenshot_1

```### PHP VERSION:
PHP 7.3.7 (cli) (built: Jul 3 2019 14:34:10) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies

LARAVEL VERSION:

laravel/framework v6.5.1 The Laravel Framework.

BACKPACK VERSION:

backpack/backupmanager 2.0.1 Admin interface for managing backups in Backpack, on Laravel 5.2+
backpack/crud 4.0.18 Quickly build an admin interfaces using Laravel 6, CoreUI, Boostrap 4 and jQuery.
backpack/generators 2.0.5 Generate files for laravel projects
backpack/logmanager 3.0.0 An interface to preview, download and delete Laravel log files.
backpack/permissionmanager 5.0.2 Users and permissions management interface for Laravel 5 using Backpack CRUD.
backpack/settings 3.0.0 Application settings interface for Laravel 5 using Backpack CRUD.```

@prodixx

Hello. I am afraid that persistentUrl error was introduced in yesterday PR.

I have already submited a fix to it.

Before that i could not reproduce your issue, and now, after fixing persistentUrl i was not able to reproduce once again.

Let tabacitu merge the fix and we give it a go once more.

Best,
Pedro

@prodixx It's fixed and merged. If you have time please try to reproduce the issue.

In case you could, please provide me with your filter implementation. Also check you are using latest files from package, you probably are, the screenshoot it's from an error introduced yesterday! :roll_eyes:

Let me know how it goes :handshake:

Best,
Pedro

It works like a charm now.

Thank you @pxpm and @tabacitu

:+1: Closing this as a solved issue :)

Thanks @jsvini and @prodixx for reporting it.

Wish you guys the best,
Pedro

Was this page helpful?
0 / 5 - 0 ratings