FriendsOfFlarum / gamification

Add upvotes, downvotes, and ranks to your Flarum Community
https://discuss.flarum.org/d/20671-friendsofflarum-gamification
MIT License
36 stars 17 forks source link

Fatal error when activating the extension #95

Closed roumilb closed 2 years ago

roumilb commented 2 years ago

Bug Report

Current Behavior Fatal error when activating the extension. I've update flarum from a beta version to the latest version (1.5) with all the extensions. Every extension is working great except when I enable Gamification

Screenshots Here is a screenshot of a discussion after I've enable the extension:

https___forum_acymailing_com_d_3926-remove-option-limit-same-ip-subscriptions_and_Meet_-_mbn-rhzq-dou_🔊

Here is a screenshot of the Home page that is blank:

AcyMailing

Environment

Here is the fatal error:

Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Unable to emit response; headers already sent in /var/www/html/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:19 Stack trace: #0 /var/www/html/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(36): Laminas\HttpHandlerRunner\Exception\EmitterException::forHeadersSent() #1 /var/www/html/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput() #2 /var/www/html/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Laminas\Diactoros\Response\HtmlResponse)) #3 /var/www/html/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run() #4 /var/www/html/public/index.php(22): Flarum\Http\Server->listen() #5 {main} thrown in /var/www/html/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php on line 19

And here is the error in the console of the home page:

TypeError: Cannot read properties of undefined (reading 'type')
    at e.pushObject (Store.ts:125:27)
    at e.pushPayload (Store.ts:103:110)
    at e.preloadedApiDocument (Application.tsx:362:22)
    at n.loadPage (DiscussionListState.ts:37:34)
    at e.refresh (PaginatedListState.ts:157:17)
    at e.refreshParams (PaginatedListState.ts:142:19)
    at n.oninit (IndexPage.tsx:46:5)
    at Function.a (render.js:30:16)
    at j (render.js:917:53)
    at render.js:153:3
imorland commented 2 years ago

I'm currently unable to replicate this error. Can you please share any relevant information from the flarum logfile? You should find this in {path_to_flarum}/storage/logs/

roumilb commented 2 years ago

Thanks the log file helped me, the column value was missing in the table post_votes, I've added it looking into the migration file 2020_07_09....php and it now works.

I think that the migration didn't worked well on the update maybe the version that I had was too old?

imorland commented 2 years ago

It's possible yes. I'll close this issue now, but feel free to reopen if you have any other problems with the issue!