Closed HeriDCLXVI closed 1 year ago
Hey @HeriDCLXVI
Can you make sure you are using the $this->crud->addBaseClause('scopeName')
? Or is it a global model scope ?
Cheers
Hi @pxpm,
this is how i use the scope, i added this in the Model, so i think it is a global model scope
@pxpm ? Bump!
Hey @tabacitu and @HeriDCLXVI I've been working on this for the past days.
I had the branch already created but haven't created the PR yet, so I did it a few moments ago: https://github.com/Laravel-Backpack/CRUD/pull/4788
It would help alot @HeriDCLXVI if you are able to pull the branch and test if it solves your use case too.
You can do that by forcing composer to use that branch with: composer require backpack/crud:"dev-always-use-the-selectRaw-expressions as 5.4.99"
Thanks for the report and let me know if you give it a test 🙏
Cheers
Hi @pxpm ,
i have tested using that branch and it is working now
Thanks for confirming @HeriDCLXVI and for providing the info that made me able to debug it 🙏
I will be closing this in favor of the PR, should be reviewed by some other team member and merged in the next release.
Cheers
Bug report
What I did
i added a scope with custom columns to filter data in list view
$builder->selectRaw('(custom_query1) as full_count, (custom_query2) as work_unit_count')->havingRaw('full_count = work_unit_count');
What I expected to happen
the data is filtered
What happened
error because my custom columns from scope is missing
What I've already tried to fix it
added
$this->crud->setOperationSetting('totalEntryCount', $this->crud->query->count());
insetupListOperation
, but the same error happens again when i try to use filter in the list viewIs it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there? yes, it is a bug caused by v5.4.0Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
PHP 8.1.2 (cli) (built: Jul 21 2022 12:10:37) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
LARAVEL VERSION:
v9.40.1@9611fdaf2db5759b8299802d7185bcdbee0340bb
BACKPACK VERSION:
5.4.7@6e1bb116de9f3091530cb9b11edcceb4d252daa8