here some log error:

POST http://localhost/flarum/public/api/posts/165

Flarum\User\Exception\PermissionDeniedException in D:\xampp\htdocs\flarum\vendor\flarum\core\src\User\User.php:606
Stack trace:
#0 D:\xampp\htdocs\flarum\vendor\flarum\core\src\User\User.php(634): Flarum\User\User->assertPermission(false)
#1 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Post\Command\EditPostHandler.php(62): Flarum\User\User->assertCan('edit', Object(Flarum\Post\CommentPost))
#2 D:\xampp\htdocs\flarum\vendor\illuminate\bus\Dispatcher.php(122): Flarum\Post\Command\EditPostHandler->handle(Object(Flarum\Post\Command\EditPost))
#3 D:\xampp\htdocs\flarum\vendor\illuminate\pipeline\Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Flarum\Post\Command\EditPost))
#4 D:\xampp\htdocs\flarum\vendor\illuminate\pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\Post\Command\EditPost))
#5 D:\xampp\htdocs\flarum\vendor\illuminate\bus\Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#6 D:\xampp\htdocs\flarum\vendor\illuminate\bus\Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\Post\Command\EditPost))
#7 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Api\Controller\UpdatePostController.php(58): Illuminate\Bus\Dispatcher->dispatch(Object(Flarum\Post\Command\EditPost))
#8 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Api\Controller\AbstractSerializeController.php(110): Flarum\Api\Controller\UpdatePostController->data(Object(Laminas\Diactoros\ServerRequest), Object(Tobscure\JsonApi\Document))
#9 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractSerializeController->handle(Object(Laminas\Diactoros\ServerRequest))
#10 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerRequest), Array)
#11 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\ExecuteRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closure))
#12 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Api\Middleware\ThrottleApi.php(33): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#13 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Api\Middleware\ThrottleApi->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#14 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#15 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#16 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\ResolveRoute.php(67): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#17 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\ResolveRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#18 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\SetLocale.php(51): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#19 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#20 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\AuthenticateWithHeader.php(56): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#21 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#22 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#23 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#24 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\RememberFromCookie.php(52): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#25 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\RememberFromCookie->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#26 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\StartSession.php(61): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#27 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\StartSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#28 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Api\Middleware\FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#29 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Api\Middleware\FakeHttpMethods->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#30 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\ParseJsonBody.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#31 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\ParseJsonBody->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#32 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\HandleErrors.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#33 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\HandleErrors->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#34 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\InjectActorReference.php(25): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#35 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\InjectActorReference->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#36 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#37 D:\xampp\htdocs\flarum\vendor\middlewares\request-handler\src\RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#38 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Middlewares\RequestHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#39 D:\xampp\htdocs\flarum\vendor\middlewares\base-path-router\src\BasePathRouter.php(101): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#40 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Middlewares\BasePathRouter->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#41 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Middleware\OriginalMessages.php(42): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#42 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Laminas\Stratigility\Middleware\OriginalMessages->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#43 D:\xampp\htdocs\flarum\vendor\middlewares\base-path\src\BasePath.php(73): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#44 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Middlewares\BasePath->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#45 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Middleware\ProcessIp.php(24): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#46 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\Next.php(61): Flarum\Http\Middleware\ProcessIp->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#47 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#48 D:\xampp\htdocs\flarum\vendor\laminas\laminas-stratigility\src\MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\EmptyPipelineHandler))
#49 D:\xampp\htdocs\flarum\vendor\laminas\laminas-httphandlerrunner\src\RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRequest))
#50 D:\xampp\htdocs\flarum\vendor\flarum\core\src\Http\Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#51 D:\xampp\htdocs\flarum\public\index.php(26): Flarum\Http\Server->listen()
#52 {main}

    Justoverclock check that your users are actually allowed to edit their posts.

    This extension probably doesn't take into account the allowed time for editing posts, so it will make you edit your previous post even if post edit is disabled or the allowed time has passed.

      Justoverclock I am not really sure but It may be caused with Fof filter or Clark's First Post approval try disabling one of them or both of them.

      1.0.1

      • Check if the user are actually allowed to edit their last post in the discussion.
      • Prevent users from by-passing the double-posting check by soft-deleting and restoring their previous post.
      a year later

      Hi, I've noticed a couple of issues with this extension:

      1) unless I'm missing something it seems that the double post check doesn't work correctly if you post a reply and then try to post a second one without refreshing the page. It will show the red banner saying that you can't reply instead of opening the composer to edit the first reply

      2) when setting the time limit to 0 users won't be able to reply in any discussion if the last post is not theirs (or in general they cannot edit it). This line in the source code should probably be something like return lastPostedUser == user && (timeLimit == 0 || !isExpired); (entirely untested)

      Thanks!

        matteocontrini thanks for reporting these, I'll look into it. This extension needs an update anyways, it's been a year already ? 😱 And almost 3 years since I met with the Flarum, time flies for real!

          a month later

          Kylo Hi, are you open to sponsorhips for speeding up working on this extension?

          • Kylo replied to this.

            andreagdipaolo honestly it isn't that I'm looking for motivation but all I've is 500 MBs of net quota for considerable amount of USDs (I currently work on a merchant ship as an engineer, and I'm literally on middle of the Atlantic Ocean as we speak - cool huh?). Updating extensions requires installing/updating packages and some spare time. If I hotspot my cellular data than the game is over, that'll be the day that my Windows eagerly waiting for 4 months. And you can't plan your spare time if you're working on a ship (especially on the engine side). So I'm thinking I'd rather spend my quota here checking on discuss, reading some news all over the world, messaging with friends, ... you know. Can't promise you anything but I do plan updating my extensions when I'm off the ship, which will happen est. 3 months later at least. PRs/takeovers are always welcomed from my side, I'd abandon any of my packages if there's a better coding for it.

              Kylo Sorry, I thought you were on land at the moment.
              Sadly I can't code, otherwise I would have contributed.

              2 months later

              I have been testing the extension on Flarum 1.6 but it's not working properly.

              After checking the repository I saw a pending PR by @Nearata but I'm not sure if I can use it in the meantime.

              Can someone confirm if it works? And how to install it without having the code merged, I tried to unzip the zip of that branch but it doesn't work.

              Thank you.

                jslirola I haven't tried it, but if you want to install it to test it yourself, you should first add the repository in your composer.json:

                ...
                "config": {
                        "preferred-install": "dist",
                        "sort-packages": true
                  }, 
                
                <-- ***From here up is flarum's default composer.json add the , and include the following:***
                
                "repositories": [
                    {
                        "type": "vcs",
                        "url": "https://github.com/Nearata/flarum-nodp"
                    }
                ]

                And then install it with:

                composer require the-turk/flarum-nodp "update"

                I wrote it as I remember, I hope it works on first try 🤞

                  Darkle Thank you! I had forgotten this process, and I have a couple of extensions like this in my environment :S

                  Preview

                  Unfortunately it doesn't work, I investigated this error and applied another change in composer including the "canonical" attribute but this way the original repository was installed instead of the other one with the fork.

                  I'll keep looking for a way to install it. If I find it I will update my message.

                    jslirola

                    already tried with dev-update ?

                    composer require the-turk/flarum-nodp "dev-update"

                      Nearata

                      Wow! Finally I was able to install your code, I didn't know the command using that version as string , thank you!

                      Almost there, it could be a compatibility issue with other extensions now. At least users can't post twice but it's not as pretty as the demo here.

                      Any idea? There is nothing in the logs and I have cleared cache several times before trying it.

                      Flarum core 1.6.3
                      PHP version: 8.1.12
                      MySQL version: 5.7.23
                      Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, bcmath, gd, intl, mysqli, pdo_mysql, soap, sockets, sodium, zip, xdebug
                      +-------------------------------------+------------+--------+
                      | Flarum Extensions                   |            |        |
                      +-------------------------------------+------------+--------+
                      | ID                                  | Version    | Commit |
                      +-------------------------------------+------------+--------+
                      | flarum-flags                        | v1.6.1     |        |
                      | flarum-sticky                       | v1.6.1     |        |
                      | flarum-markdown                     | v1.6.1     |        |
                      | flarum-tags                         | v1.6.1     |        |
                      | flarum-suspend                      | v1.6.1     |        |
                      | flarum-lock                         | v1.6.1     |        |
                      | flarum-approval                     | v1.6.1     |        |
                      | afrux-forum-widgets-core            | v0.1.7     |        |
                      | zerosonesfun-direct-links           | 3.1        |        |
                      | zerosonesfun-composer-preview       | 1.1.9      |        |
                      | v17development-seo                  | v1.8.0     |        |
                      | the-turk-stickiest                  | 2.0.3      |        |
                      | the-turk-nodp                       | dev-update |        |
                      | michaelbelgium-discussion-views     | v7.2       |        |
                      | matteocontrini-imgur-upload         | v3.9.1     |        |
                      | maicol07-sso                        | 1.11.4     |        |
                      | kyrne-whisper                       | v0.1.7     |        |
                      | kilowhat-audit-free                 | 1.6.0      |        |
                      | justoverclock-welcomebox            | 1.3.8      |        |
                      | justoverclock-custom-html-widget    | 0.1.4      |        |
                      | fof-user-bio                        | 1.1.1      |        |
                      | fof-terms                           | 1.2.0      |        |
                      | fof-sitemap                         | 1.0.3      |        |
                      | fof-share-social                    | 1.1.2      |        |
                      | fof-pretty-mail                     | 1.1.1      |        |
                      | fof-masquerade                      | 1.0.0      |        |
                      | fof-links                           | 1.1.2      |        |
                      | fof-forum-statistics-widget         | 1.0.2      |        |
                      | fof-formatting                      | 1.0.2      |        |
                      | fof-disposable-emails               | 1.0.0      |        |
                      | fof-cookie-consent                  | 1.1.1      |        |
                      | flarum-subscriptions                | v1.6.3     |        |
                      | flarum-statistics                   | v1.6.1     |        |
                      | flarum-mentions                     | v1.6.3     |        |
                      | flarum-likes                        | v1.6.1     |        |
                      | flarum-lang-spanish                 | 1.5.0      |        |
                      | flarum-emoji                        | v1.6.1     |        |
                      | flarum-bbcode                       | v1.6.0     |        |
                      | davwheat-ads                        | 1.2.0      |        |
                      | datlechin-link-preview              | v1.2.3     |        |
                      | clarkwinkelmann-post-permissions    | 1.0.0      |        |
                      | clarkwinkelmann-first-post-approval | 1.0.1      |        |
                      | clarkwinkelmann-emojionearea        | 1.0.0      |        |
                      | askvortsov-categories               | v3.0.6     |        |
                      +-------------------------------------+------------+--------+