Team-Tea-Time / laravel-forum

A slim, lean forum package designed for quick and easy integration in Laravel projects
https://laravel-forum.teamteatime.net/
MIT License
601 stars 165 forks source link

FatalThrowableError in BaseController.php line 51 #159

Closed Littie closed 6 years ago

Littie commented 7 years ago

Hi. Fresh install:

    "laravel/framework": "5.3.*",
    "riari/laravel-forum": "~4.0",
    "riari/laravel-forum-frontend": "~1.0"

When i try delete any category or thread or post i get exception. For example, if delete any post appear next exception:

Type error: Argument 2 passed to Riari\Forum\Frontend\Http\Controllers\BaseController::handleResponse() must be an instance of Illuminate\Http\Response, instance of Illuminate\Http\RedirectResponse given, called in .../vendor/riari/laravel-forum/src/API/Dispatcher.php on line 135

Use debug, i found that $request variable in bulkDestroy() method, that called when deleting post doesn't contain "force" parameter. So in dispatch() method in Route::dispatch($request) line returned RedirectResponse with ValidationException message "The force field must be true or false."

How can i resolve this problem?

hardiktailored commented 7 years ago

Same issue I have when deleting category which have sub category or deleting bulk thread. Have you got any resolution? I removed "HttpResponseException" method and using just redirecting with message in BaseController(I override controllers so) resolved issue for category delete message. But bulk delete giving the exact same error you have.

hardiktailored commented 7 years ago

I resolved error with assigning default value to force parameter in controller: $parameters['force'] = 0; But I will still need to resolve the original issue we have.

kishoresai438 commented 7 years ago

Hi @hardiktailored , I am also facing category delete issue which are having threads. Getting "HttpResponseAction" Not found error. How can I override forum controllers(BaseController) which are located on "Vendor" folder ? How can we control forum routes? Can you please suggest

mohabhassan commented 6 years ago

fixed here: riari/laravel-forum-frontend#26