[Bug] Tabs feature launches dozens of duplicate queries
See original GitHub issueAs you can see in the attached pic, as soon as I activate Tabs, previous 6 queries jumps to 30, most of them duplicated. Debugbar traces the queries to view::crud::inc.show_tabbed_fields:41 located in show_tabbed_fields.blade.php, that reads @include('crud::inc.show_fields', ['fields' => $crud->getTabFields($tab)])
I wasn’t able to trace it any further, but I confirmed the issue dissapears if I remove the tabs. Confirmed also in Gitter with @OwenMelbz and @automat64 so it doesn’t seem to be something with my setup.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Reformulating Queries for Duplicate Bug Report Detection
Abstract—When bugs are reported, one important task is to check if they are new or if they were reported before. Many.
Read more >Tab History - Duplicate Entries - Redgate forums
For duplicate tabs, I'm finding that one instance opens the tab as expected and the duplicate instance displays an error Document not found....
Read more >142855 - Duplicate history entries in BACK menu - Monorail
Issue 142855: Duplicate history entries in BACK menu · 1. close all tabs, and close browser · 2. open browser with default blank...
Read more >Dashboard Tabs and Unwanted Query Duplicates
I just realized that when I was cloning my dashboards and tabs I was leaving "Clone Query" selected- that is probably causing the...
Read more >Firefox repeatedly opens empty tabs or windows after you ...
Firefox may repeatedly open new, empty tabs or windows after you click on a link, forcing you to close Firefox. The same untitled...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay @MarcosBL here we go
First we’ll need to create the class we will use to override the base class in the vendor directory. I’ll be storing the files in the
app/Src/Backpack
directory.Create the following class and call it
CrudPanel
. Notice this extends\Backpack\CRUD\CrudPanel
and we are just overriding thegetEntity
method (this is found in theread
trait in the CrudPanel class we are extending)We also need to create a new
CrudController
as this is where theCrudPanel
is used. Create the following class. Notice we are extending the\Backpack\CRUD\app\Http\Controllers\CrudController
class. We are only overriding the constructor as we need to ensure we are using our newly createdCrudPanel
. As we are still in the same namespaceApp\Src\Backpack
theCrudPanel
will be our created one 😃The only thing left to do is use our newly created class
App\Src\Backpack\CrudController
instead of the standard\Backpack\CRUD\app\Http\Controllers\CrudController
in all of our Crud Controllers that have the issue. Just swap out the class you are extending from\Backpack\CRUD\app\Http\Controllers\CrudController
toApp\Src\Backpack\CrudController
.I hope this helps.
If you’re still stuck just ask.
No problem @MarcosBL, glad it helped.
Please be aware this is not a fix, just a workaround. The
getEntity
method is still getting called multiple times. This workaround just ensures the query is called only once!