"Call to undefined method Backend\Models\User::categories()" on line 71 of C:\xampp2\htdocs\october\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php
Closed this issue · 9 comments
octobercms 3 php 8
Stacktrace? Pageload? Request? php 8.0, php 8.1?
Yes php 8.0 windows 10 xampp. Error when clicking send test email and newsletter. Other crud models are fine.
can you share us the stacktrace?
Backend -> System settings -> Event Log -> log entry -> stacktrace
BadMethodCallException: Call to undefined method Backend\Models\User::categories() in C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php:71
Stack trace:
#0 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException('categories')
#1 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(2321): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(October\Rain\Database\Builder), 'categories', Array)
#2 C:\xampp\htdocs\october\vendor\october\rain\src\Extension\ExtendableTrait.php(511): Illuminate\Database\Eloquent\Model->__call('categories', Array)
#3 C:\xampp\htdocs\october\vendor\october\rain\src\Database\Model.php(305): October\Rain\Database\Model->extendableCall('categories', Array)
#4 C:\xampp\htdocs\october\plugins\indikator\news\classes\NewsSender.php(180): October\Rain\Database\Model->__call('categories', Array)
#5 C:\xampp\htdocs\october\plugins\indikator\news\classes\NewsSender.php(225): Indikator\News\Classes\NewsSender->prepareNewsletterParametersForReceiver(Object(Backend\Models\User))
#6 C:\xampp\htdocs\october\plugins\indikator\news\classes\NewsSender.php(88): Indikator\News\Classes\NewsSender->sendTest(Object(Backend\Models\User))
#7 C:\xampp\htdocs\october\plugins\indikator\news\controllers\Posts.php(57): Indikator\News\Classes\NewsSender->sendTestNewsletter()
#8 C:\xampp\htdocs\october\modules\system\traits\DependencyMaker.php(29): Indikator\News\Controllers\Posts->onTest('1')
#9 C:\xampp\htdocs\october\modules\backend\classes\Controller.php(602): Backend\Classes\Controller->makeCallMethod(Object(Indikator\News\Controllers\Posts), 'onTest', Array)
#10 C:\xampp\htdocs\october\modules\backend\classes\Controller.php(447): Backend\Classes\Controller->runAjaxHandler('onTest')
#11 C:\xampp\htdocs\october\modules\backend\classes\Controller.php(256): Backend\Classes\Controller->execAjaxHandlers()
#12 C:\xampp\htdocs\october\modules\backend\classes\BackendController.php(127): Backend\Classes\Controller->run('update', Array)
#13 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): Backend\Classes\BackendController->run('indikator/news/...')
#14 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction('run', Array)
#15 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Backend\Classes\BackendController), 'run')
#16 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Route.php(205): Illuminate\Routing\Route->runController()
#17 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Router.php(727): Illuminate\Routing\Route->run()
#18 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#19 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#20 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#22 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#24 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#25 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#27 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#29 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#31 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Router.php(728): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#32 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Router.php(705): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#33 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Routing\Router.php(669): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#34 C:\xampp\htdocs\october\vendor\october\rain\src\Router\CoreRouter.php(32): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#35 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(190): October\Rain\Router\CoreRouter->dispatch(Object(Illuminate\Http\Request))
#36 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#37 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#38 C:\xampp\htdocs\october\vendor\october\rain\src\Foundation\Http\Middleware\CheckForMaintenanceMode.php(23): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#41 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(165): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#42 C:\xampp\htdocs\october\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(134): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#43 C:\xampp\htdocs\october\index.php(43): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#44 {main}
is that it?
These two patches should fix it for ocms2
thank yout but how about ocms3? send newsletter also fixed?