October: Why "has" not worked in scheduler?

Created on 11 Sep 2018  路  3Comments  路  Source: octobercms/october

I have a class with a static method.
If I run the method from the controller button, then everything works.

Achievement::has('filters')->with('filters')->get(); 

filters - relationship Many To Many

But if I run method from scheduler.

Achieves::checkAchievements(); // example, In this method, there is a code block written above

It stops working.
And displays an error in the log:

ErrorException: compact(): Undefined variable: operator in /var/www/ag/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1243
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'compact(): Unde...', '/var/www/ag/www...', 1243, Array)
#1 /var/www/ag/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1243): compact('type', 'operator', 'query', 'boolean')
#2 /var/www/ag/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1286): Illuminate\Database\Query\Builder->addWhereExistsQuery(Object(October\Rain\Database\QueryBuilder), 'and', false)
#3 /var/www/ag/www/vendor/october/rain/src/Database/Builder.php(178): Illuminate\Database\Eloquent\Builder->__call('addWhereExistsQ...', Array)
#4 /var/www/ag/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php(241): October\Rain\Database\Builder->__call('addWhereExistsQ...', Array)
...

If i change first record on:

Achievement::with('filters')->get(); 

everything is working

October build

442

Bug third party

Most helpful comment

That was fixed in laravel 5.5.43
Just do composer update and probrem will be solved :)

All 3 comments

Sounds like a Laravel issue, have you tried googling for that?

Yes, I was googling, but so far nothing has been found

That was fixed in laravel 5.5.43
Just do composer update and probrem will be solved :)

Was this page helpful?
0 / 5 - 0 ratings