Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Persistent datatable filters causes incorrect redirects with multiple projects on subdomains #5076

Closed
madriegh opened this issue May 17, 2023 · 1 comment
Labels

Comments

@madriegh
Copy link
Contributor

Bug report

What I did

Install two project instances on subdomains, e.g. www.example.com/first and www.example.com/second
Create a CRUD panel with a list view and add filters.
Go to www.example.com/first/admin/your-crud. 
Select a filter. You will see that the 'admin_yourcrud_list_url' key is set in localStorage to enable the persistent filters.
Go to www.example.com/second/admin/your-crud

What I expected to happen

www.example.com/**second**/admin/your-crud opens

What happened

It will redirect back to the persisted url in the localStorage, which is www.example.com/first/admin/your-crud, the incorrect subdomain.

What I've already tried to fix it

I submitted a PR where I took the full url as key prefix for the localStorage instead of solely the route (#4843)

Is it a bug in the latest version of Backpack? Yes

After I run composer update backpack/crud the bug... is it still there? Yes

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

PHP 8.1.10 (cli) (built: Sep 4 2022 08:41:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans
with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies

LARAVEL VERSION:

v9.40.1@9611fdaf2db5759b8299802d7185bcdbee0340bb

BACKPACK VERSION:

5.3.12@883ff76f74bb4cdb70559990026b1130db5234f6

@tabacitu
Copy link
Member

Nice, thanks for the detailed explanation @madriegh ! Let's close the issue itself in favor of your PR - #4843 - that way we have the conversation and solution in one spot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants