-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug] Filters not working as it does not find views #3093
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Hello @iamraju Actually the code for getting the filters is:
@foreach ($crud->filters() as $filter)
@include($filter->getViewWithNamespace())
@endforeach My guess is that you have that file published and backpack is picking the one you override in resources instead of the one in the package. It could be a cache problem I don't think this is a bug, so I am going to close this. If you still feel this is a bug, please re-open. Best, |
Hi There, Thanks for taking care of the issue I posted. Yes, later I found that the code is changed but strange part is; even when published new views, is there a way to re-publish all the view files ? I see a command |
@iamraju There is no command to publish all the the Backpack view files. I don't think publishing ALL Bacpack views is a good pratice. I think publishing only the ones you are going to change makes more sense. Best, |
@pxpm I do totally agree in general it is not good to publish all but I am not sure what files are/were modified and hence I just wanted to republish all. Now the filter fields problem resolved, it works but now buttons giving trouble. Like I cannot see button to Create New model in the listing page. I tried re-publishing the By the way, one small correction you guys need to make is; the example in arguments of the command Thank you again for responding. |
@iamraju if you are not doing customization in the files you could just delete them from your resources folder and backpack will pick the ones in the package. It's kind of the same of publishing all files and overwrite the changes so ... About the publishing you should look at backpack folder structure and give the appropriate path to the file you want to publish. Best, |
Thanks @pxpm for continuous reply ! But even when I deleted all the published files/folders, I cannot see buttons, not sure where and what happened. I am exploring myself the codebase but if you have any direction to point to, that would save my time ! |
My guess then is that you need to re-publish backpack assets and clear caches. Check step 13 of upgrade guide: https://backpackforlaravel.com/docs/4.1/upgrade-guide#step-13 Then clear your caches: Best, |
That did not help either. I tried that running the commands in step 13. Actually I tried
So it should be something in the framework itself or another doubt permission stuffs on which I am yet to check in details. By the way, this is happening only in my upgraded project (4.0 to 4.1), but it is working in fresh/new installation. |
Bug report
Filters are not working.
What I did
I did upgraded from 4.0 to 4.1, I tried all the steps mentioned in the documentation and tried to visit my listing page (ListOperation). I have couple fields to be available to search/filter.
What I expected to happen
I had expected to work the filters as it is working with 4.0.
What happened
In ListOperation (Listing page), I found the following error message:
What I've already tried to fix it
When I tried to look at file filters_navbar.blade.php, there is a loop:
Here
$filter->view
is returning only view name i.e.text
,select2
, etc, rather it expects something likecrud:filters.text
. I found the Trait Filters has been modified a lot and I did not find extra classes in it.Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:Not sure what I missed to perform.
The text was updated successfully, but these errors were encountered: