有后端过滤器列表问题

Having a backend filter list issue

对于我的两个发行版,我在过滤任何后端模型列表时遇到了一个独特的问题。他们有不同的插件。他们两者之间最常见的事情是他们有我首先使用 Builder 插件创建的自定义插件。它们还托管在不同的 linux 服务器上。

错误是:

Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of Backend\Widgets\Lists::putUserPreference() must be an instance of Backend\Traits\void, none returned in /home/deltarv/public_html/modules/backend/traits/PreferenceMaker.php

这是日志跟踪:

#0 /home/deltarv/public_html/modules/backend/widgets/Lists.php(1598): Backend\Widgets\Lists->putUserPreference('visible', Array)
#1 [internal function]: Backend\Widgets\Lists->onApplySetup()
#2 /home/deltarv/public_html/modules/backend/classes/Controller.php(657): call_user_func_array(Array, Array)
#3 /home/deltarv/public_html/modules/backend/classes/Controller.php(601): Backend\Classes\Controller->runAjaxHandlerForWidget(Object(Backend\Widgets\Lists), 'onApplySetup')
#4 /home/deltarv/public_html/modules/backend/classes/Controller.php(470): Backend\Classes\Controller->runAjaxHandler('list::onApplySe...')
#5 /home/deltarv/public_html/modules/backend/classes/Controller.php(267): Backend\Classes\Controller->execAjaxHandlers()
#6 /home/deltarv/public_html/modules/backend/classes/BackendController.php(161): Backend\Classes\Controller->run('index', Array)
#7 [internal function]: Backend\Classes\BackendController->run('rainlab/user/us...')
#8 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#9 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('run', Array)
#10 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Backend\Classes\BackendController), 'run')
#11 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\Routing\Route->runController()
#12 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Route->run()
#13 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#14 /home/deltarv/public_html/modules/backend/classes/BackendController.php(68): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#15 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(131): Backend\Classes\BackendController->Backend\Classes\{closure}(Object(Illuminate\Http\Request), Object(Closure))
#16 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#18 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#21 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#30 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#33 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(660): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#34 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#35 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(601): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#36 /home/deltarv/public_html/vendor/october/rain/src/Router/CoreRouter.php(20): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#37 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): October\Rain\Router\CoreRouter->dispatch(Object(Illuminate\Http\Request))
#38 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#39 /home/deltarv/public_html/plugins/offline/speedy/classes/middleware/CDNMiddleware.php(40): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#40 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): OFFLINE\Speedy\Classes\Middleware\CDNMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 /home/deltarv/public_html/plugins/offline/speedy/classes/middleware/Http2Middleware.php(38): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#43 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): OFFLINE\Speedy\Classes\Middleware\Http2Middleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#46 /home/deltarv/public_html/vendor/october/rain/src/Foundation/Http/Middleware/CheckForMaintenanceMode.php(24): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#50 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#51 /home/deltarv/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#52 /home/deltarv/public_html/index.php(43): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

此错误与 void datatype 有关。它是在 PHP 7.1 中引入的。它在较低的 PHP 版本中导致错误问题。

https://wiki.php.net/rfc/void_return_type

对于 php 的较低版本,它被视为外部类型。 void 在默认数据类型中找不到,因此它变为 Backend\Traits\void

So it was complaining about that. once you update PHP to 7.1 error should go away.