Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKFinder.WARNING: ErrorException: Since symfony/http-foundation 5.1: The "Symfony\Component\HttpFoundation\JsonResponse::create()" method is deprecated, use "new CKSource\CKFinder\Response\JsonResponse()" #63

Closed
fynntang opened this issue Mar 28, 2021 · 4 comments

Comments

@fynntang
Copy link

fynntang commented Mar 28, 2021

$ php artisan --version
Laravel Framework 8.34.0

[2021-03-28T14:02:11.499831+00:00] CKFinder.WARNING: ErrorException: Since symfony/http-foundation 5.1: The "Symfony\Component\HttpFoundation\JsonResponse::create()" method is deprecated, use "new CKSource\CKFinder\Response\JsonResponse()" instead. in /var/www/hfm/vendor/symfony/deprecation-contracts/function.php:25 Stack trace:
#0 [internal function]: CKSource\CKFinder\ExceptionHandler->errorHandler(16384, 'Since symfony/h...', '/var/www/hfm/ve...', 25, Array)
#1 /var/www/hfm/vendor/symfony/deprecation-contracts/function.php(25): trigger_error('Since symfony/h...', 16384)
#2 /var/www/hfm/vendor/symfony/http-foundation/JsonResponse.php(75): trigger_deprecation('symfony/http-fo...', '5.1', 'The "%s()" meth...', 'Symfony\Compone...', 'CKSource\CKFind...')
#3 /var/www/hfm/vendor/ckfinder/ckfinder-laravel-package/_connector/CKFinder.php(280): Symfony\Component\HttpFoundation\JsonResponse::create(Object(stdClass))
#4 /var/www/hfm/vendor/symfony/event-dispatcher/EventDispatcher.php(230): CKSource\CKFinder\CKFinder->createResponse(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#5 /var/www/hfm/vendor/symfony/event-dispatcher/EventDispatcher.php(59): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'kernel.view', Object(Symfony\Component\HttpKernel\Event\ViewEvent)) #6 /var/www/hfm/vendor/symfony/http-kernel/HttpKernel.php(162): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#7 /var/www/hfm/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Illuminate\Http\Request), 1)
#8 /var/www/hfm/vendor/ckfinder/ckfinder-laravel-package/_connector/CKFinder.php(515): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Illuminate\Http\Request), 1, false)
#9 /var/www/hfm/vendor/ckfinder/ckfinder-laravel-package/src/Controller/CKFinderController.php(48): CKSource\CKFinder\CKFinder->handle(Object(Illuminate\Http\Request), 1, false)
#10 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): CKSource\CKFinderBridge\Controller\CKFinderController->requestAction(Object(Illuminate\Foundation\Application), Object(Illuminate\Http\Request))
#11 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('requestAction', Array)
#12 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(CKSource\CKFinderBridge\Controller\CKFinderController), 'requestAction')
#13 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\Routing\Route->runController()
#14 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\Routing\Route->run()
#15 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#16 /var/www/hfm/app/Http/Middleware/CustomCKFinderAuth.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#17 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CustomCKFinderAuth->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 /var/www/hfm/app/Http/Middleware/BackendAuthenticate.php(29): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#19 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\BackendAuthenticate->handle(Object(Illuminate\Http\Request), Object(Closure), 'backend')
#20 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#21 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#23 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /var/www/hfm/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#25 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#27 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#29 /var/www/hfm/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))
#30 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#32 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#34 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#36 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#37 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#38 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#39 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#40 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#41 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#42 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#43 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#45 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#47 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#49 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /var/www/hfm/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#51 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 /var/www/hfm/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#53 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#55 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#56 /var/www/hfm/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#57 /var/www/hfm/public/index.php(61): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#58 {main} [] []

@nhv96
Copy link

nhv96 commented Apr 23, 2021

I have this same problem too, with weird behavior that some images are failed to upload and if upload again it is success (some cases it just failed to upload).
My environment:

  • Laravel 8.38 with Docker environment
  • PHP 8.0.3
  • CKEditor 4
  • CKFinder 3.5.1.7

@mgsmus
Copy link

mgsmus commented Apr 28, 2021

It should be $event->setResponse(new JsonResponse($controllerResult)); instead of $event->setResponse(JsonResponse::create($controllerResult)); at /vendor/ckfinder/ckfinder-laravel-package/_connector/CKFinder.php:280 but unfortunately that part comes directly from the CKFinder source, so there is no correct way to fix it except modify the source code in vendor folder...

@SergFill
Copy link

No this fix no good, see this https://saitsozdanie.ru/forum/index.php?topic=9462.0

@zaak
Copy link
Member

zaak commented Nov 17, 2022

This issue has been fixed in the latest version.

@zaak zaak closed this as completed Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants