7 days later

In a future update would it be possible to have the user rank number listed under the profile picture when they post?

5 days later

Things seem to work fine with this extension. But, it's not converting my likes into upvotes. The instructions say to wait a few minutes. I waited all day. My log is below.

If it helps I'm using the latest version of Flarum, and PHP 7.3. Maybe it's a conflict with another extension. I know that when I tried this extension in the past, when it was still a reflar extension, something didn't work for me (I forget what) and so I removed it. I want to say it was an extension conflict back then; so maybe that's the problem again this time... But, I love the upvoting and other features so much that I really don't want to remove it again.

See anything obvious?

[2019-07-21 17:09:45] production.ERROR: Error: Class 'FoF\Gamification\vote' not found in /vendor/fof/gamification/src/Gamification.php:126
Stack trace:
#0 /vendor/fof/gamification/src/Api/Controllers/ConvertLikesController.php(65): FoF\Gamification\Gamification->convertLike('13', '4')
#1 /vendor/flarum/core/src/Http/RouteHandlerFactory.php(40): FoF\Gamification\Api\Controllers\ConvertLikesController->handle(Object(Zend\Diactoros\ServerRequest))
#2 /vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(67): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Zend\Diactoros\ServerRequest), Array)
#3 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\DispatchRoute->process(Object(Zend\Diactoros\ServerRequest), Object(Closure))
#4 /vendor/reflar/stopforumspam/src/Middleware/RegisterMiddleware.php(75): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#5 /vendor/zendframework/zend-stratigility/src/Next.php(60): Reflar\Stopforumspam\middleware\RegisterMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#6 /vendor/fof/secure-https/src/Middlewares/ContentSecurityPolicyMiddleware.php(21): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#7 /vendor/zendframework/zend-stratigility/src/Next.php(60): FoF\SecureHttps\Middlewares\ContentSecurityPolicyMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#8 /vendor/flagrow/terms/src/Middlewares/RegisterMiddleware.php(59): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#9 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flagrow\Terms\Middlewares\RegisterMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#10 /vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#11 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\SetLocale->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#12 /vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(33): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#13 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#14 /vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(56): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#15 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#16 /vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(34): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#17 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#18 /vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#19 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\RememberFromCookie->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#20 /vendor/flarum/core/src/Http/Middleware/StartSession.php(62): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#21 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\StartSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#22 /vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(31): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#23 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Api\Middleware\FakeHttpMethods->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#24 /vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(29): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#25 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\ParseJsonBody->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#26 /vendor/flarum/core/src/Api/Middleware/HandleErrors.php(42): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#27 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Api\Middleware\HandleErrors->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#28 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#29 /vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#30 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#31 /vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#32 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePathRouter->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#33 /vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php(41): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#34 /vendor/zendframework/zend-stratigility/src/Next.php(60): Zend\Stratigility\Middleware\OriginalMessages->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#35 /vendor/middlewares/base-path/src/BasePath.php(53): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#36 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePath->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#37 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#38 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\EmptyPipelineHandler))
#39 /vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\Stratigility\MiddlewarePipe->handle(Object(Zend\Diactoros\ServerRequest))
#40 /vendor/flarum/core/src/Http/Server.php(46): Zend\HttpHandlerRunner\RequestHandlerRunner->run()
#41 /public_html/index.php(22): Flarum\Http\Server->listen()
#42 {main}

Next Exception: Class 'FoF\Gamification\vote' not found in /vendor/flarum/core/src/Api/ErrorHandler.php:41
Stack trace:
#0 /vendor/flarum/core/src/Api/Middleware/HandleErrors.php(44): Flarum\Api\ErrorHandler->handle(Object(Error))
#1 /vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Api\Middleware\HandleErrors->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#2 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#3 /vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#4 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#5 /vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#6 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePathRouter->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#7 /vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php(41): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#8 /vendor/zendframework/zend-stratigility/src/Next.php(60): Zend\Stratigility\Middleware\OriginalMessages->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#9 /vendor/middlewares/base-path/src/BasePath.php(53): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#10 /vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePath->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#11 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#12 /vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\EmptyPipelineHandler))
#13 /vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\Stratigility\MiddlewarePipe->handle(Object(Zend\Diactoros\ServerRequest))
#14 /vendor/flarum/core/src/Http/Server.php(46): Zend\HttpHandlerRunner\RequestHandlerRunner->run()
#15 /public_html/index.php(22): Flarum\Http\Server->listen()
#16 {main}

    010101 Looks like it was a small capitalization error.

    How to get it setup now:

    1. Update to version 0.1.3
    2. Delete fof-gamification.convertedLikes in the settings table of your Flarum database in mysql
    3. Re-run the conversion in the admin panel.
      15 days later

      Hey there - Just want to make sure you are aware that this extension still causes this delete forever issue discussed here:

      flarum/core1717

        010101

        0.1.4

        Additions 🛠️

        • Added ability to show original post votes on the discussion page (optional)
        • Added ability to turn on the vote floodgate (now off by default)

        Fixed Issues 🐛

        • Fixed an issue that caused an error to popup on post deletion
        • Fixed an issue that caused votes to not be removed from a user when a post was deleted
        • Fixed an issue that caused user ranks to not be removed when a vote was deleted

        Optimization 🧠

        • Simplified post vote/user rank creation and deletion logic

        Updating ⬆️

        Run these commands in your Flarum root directory:

        composer update fof/gamification
        php flarum migrate
          • [deleted]

          Curious to know if there is any reason for the styling on the Ranking page not matching that of the main view. By this, I mean that in the main view, the navigation pane is on the left, and in the ranking view, it's across the top with a scroll bar. This makes it look out of place, and, a bit...well..."ugly" 🙂

            • [deleted]

            Ralkage I can't, as we block all Social Media here - IMGUR falls into that category also 🙂 Anyone with this extension installed will be able to attest to what I mean !

            • [deleted]

            Seem to have an error when performing php flarum migrate on one of my forums

            In Connection.php line 664:


            SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (guruwall_discuss.#sql-1b37f_2171b, CONSTRAINTpost_votes_post_id_foreignFOREIGN KEY (post_id) REFERENCESposts(id) ON DELETE CASCADE) (SQL: alter tablepost_votesadd constraintpost_votes_post_id_foreignforeign key (post_id) referencesposts(id) on delete cascade)


            In PDOStatement.php line 119:


            SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (guruwall_discuss.#sql-1b37f_2171b, CONSTRAINTpost_votes_post_id_foreignFOREIGN KEY (post_id) REFERENCESposts(id) ON DELETE CASCADE)

            In PDOStatement.php line 117:


            SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (guruwall_discuss.#sql-1b37f_2171b, CONSTRAINTpost_votes_post_id_foreignFOREIGN KEY (post_id) REFERENCESposts(id) ON DELETE CASCADE)

            Any ideas ?

            Thanks

              I am making a fork of this extension because our client wants both features of fof/gamification and reflar/level-ranks.

              I don't know if this would make sense to merge into the main repo...

              Now I was wondering if the latest version of fof/gamification is theoretically compatible with Flarum beta 8.1 or not. The composer.json specifies that it is only compatible with beta 9 but after I changed it to beta 8.1 there apparently is no real proble. We are still using beta 8.1 because there is an issue in beta 9 that is critical for our client.

                iPurpl3x Are you asking if changing flarum/core version requirement would make sense to merge into the main repo ? If so, that can be changed.

                  iPurpl3x Not sure what you mean here, as Gamification and Level Rank aren't related. Do you mean a progress bar like reflar/level-rank that uses the user's ranks?

                    datitisev what I think @iPurpl3x means is that he believes they should be merged into one extension because "levelling" is considered a form of "gamification" in theory. Overall, there are a lot of neat features that could be added to this extension but it would take a tremendous amount of time and effort to implement various activities centred around gamification. But to answer your question, I believe what you just said is what he actually means,

                    But you and I both already agreed that Level Ranks needed a rewrite anyway, so much to be done with so little time 😪

                      datitisev Well that and ranking based on levels instead of points, or both : make it configurable. And for the users "points", take into account the comment_count and the post_count because. The formula that would weight the different types of activities should also be configurable if possible.
                      Ralkage That right, and I just think that it would make sense to abandon level-ranks and integrate its feature to gamification. But as you said that's a lot of work...