• Issue
  • Latest post not showing for tag (e.g. POSTNAME - AN HOUR AGO) on Tags page

Here is the link to my forum - https://fragmart.flarum.cloud/tags.

The issue

I have installed the forum and set up everything, but the latest posts are not showing under the new tags I have created. It shows the latest post I made under Announcements and Selling, but my friend has made a post under Discussions (brown one) from his account and it’s blank, doesn’t update.

Here’s a screenshot for reference:

It also wasn’t updating under Selling but then it suddenly updated a couple of hours later. The Discussions hasn’t updated now in 10+ hours.

Can someone please help me figure out why is that? Thank you for the help!

    • Edited

    fragmart I guess that this is either a bug in the Tags extension, or a conflict between “Boring Avatars”. The latest discussions weren’t updated in your forum’s database (tags table):

    +---------------+---------------+---------------------+---------------------------+---------------------+
    | name          | slug          | last_posted_at      | last_posted_discussion_id | last_posted_user_id |
    +---------------+---------------+---------------------+---------------------------+---------------------+
    | Announcements | announcements | 2025-02-15 19:39:13 |                         2 |                   1 |
    | Selling       | selling       | 2025-02-15 21:29:46 |                         4 |                   3 |
    | Buying        | buying        | NULL                |                      NULL |                NULL |
    | Trading       | trading       | NULL                |                      NULL |                NULL |
    | Discussions   | discussions   | NULL                |                      NULL |                NULL |
    | Off Topic     | off-topic     | NULL                |                      NULL |                NULL |
    +---------------+---------------+---------------------+---------------------------+---------------------+

    In your forum’s server-side logs, there is the following error:

    flarum.ERROR: Illuminate\Contracts\Container\BindingResolutionException: Target [IanM\BoringAvatars\BoringAvatar] is not instantiable while building [IanM\BoringAvatars\Command\GenerateAvatarHandler]. in /data/host/skeleton/vendor/illuminate/container/Container.php:1089
    Stack trace:
    #0 /data/host/skeleton/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable()
    #1 /data/host/skeleton/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
    #2 /data/host/skeleton/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
    #3 /data/host/skeleton/vendor/illuminate/container/Container.php(1027): Illuminate\Container\Container->make()
    #4 /data/host/skeleton/vendor/illuminate/container/Container.php(947): Illuminate\Container\Container->resolveClass()
    #5 /data/host/skeleton/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->resolveDependencies()
    #6 /data/host/skeleton/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
    #7 /data/host/skeleton/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
    #8 /data/host/skeleton/vendor/flarum/core/src/Bus/Dispatcher.php(21): Illuminate\Container\Container->make()
    #9 /data/host/skeleton/vendor/illuminate/bus/Dispatcher.php(118): Flarum\Bus\Dispatcher->getCommandHandler()
    #10 /data/host/skeleton/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow()
    #11 /data/host/skeleton/vendor/ianm/boring-avatars/src/Job/AvatarGenerationBatch.php(36): Illuminate\Bus\Dispatcher->dispatch()
    #12 /data/host/skeleton/vendor/illuminate/collections/Traits/EnumeratesValues.php(245): IanM\BoringAvatars\Job\AvatarGenerationBatch->IanM\BoringAvatars\Job\{closure}()

    The Tags seem to be updated only when the discussion is created (https://github.com/flarum/tags/blob/2.x/src/Listener/UpdateTagMetadata.php#L120-L135). I don’t know if the “Boring Avatars” extension somehow interferes with this, so try disabling that extension and posting again to see if the tag count updates?

      SKevo thank you for the help. Boring Avatars was disabled already… I have tried enabling and disabling them, then purging and clearing cache, and posting again but it still doesn’t work :/

      Is it possible that you delete all Boring Avatars data from your side?

        fragmart Boring Avatars was disabled already…

        Oh I see, in that case, apologies. It looks like it’s not a problem within that extension then, and frankly, I have no idea what might be wrong. If you want, I can create a temporary account at your forum to look at it in more detail?

        fragmart Is it possible that you delete all Boring Avatars data from your side?

        Technically yes, but as I have mentioned, I doubt it will fix it? If the extension is disabled, it shouldn’t interfere with other extensions, AFAIK

          SKevo yes sure, I’d be glad if we can figure it out so it works!

          I was thinking of putting tags on the homepage (instead of discussions), but it makes less sense if it’s not updating with latest posts..

          Thank you once again for the help 🙂

            • Edited

            fragmart hmm from what I see, it might be because of the Approval extension? When the extension is created, it is hidden by default, so maybe that means it shouldn’t show up publicly in the tags list? I don’t know how the Tags extension works internally, but judging from the source code, I assume that all discussions that weren’t set as last discussion in the tag are refreshed later - once someone posts in that tag and the post can show up publicly immediately (or maybe all latest discussions are refreshed after a discussion is posted in any tag).

            If I gave myself admin perms, I could post without approval, so the discussion is shown immediately. And that indeed did update the discussion in the tag list (as last created discussion). Could you please confirm my hypothesis by either giving your friend the permission to post without approval, or simply disabling the approval extension and see if it updates the latest discussion for your friend? I am sure this is a bug in the Tags extension (in that case, please report it at https://discuss.flarum.org - the conditional check will likely need to include a case for the approval ext)

            Edit: FYI approving the discussion does not update the latest discussion list for that tag either, which is likely the culprit and the actual bug that needs to be fixed

              SKevo I have just tried myself and you are right. When posting without approval, the latest post is instantly shown in tags’ last posts. However, now when I have deleted the latest test posts, the last ‘real post’ is showing also. So how and when has database updated?

              I’ll go over there and report it right now. Thank you very much once again.

                • Edited

                fragmart So how and when has database updated?

                Well, this is how the tags table looks like right now:

                +---------------+---------------+---------------------+---------------------------+---------------------+
                | name          | slug          | last_posted_at      | last_posted_discussion_id | last_posted_user_id |
                +---------------+---------------+---------------------+---------------------------+---------------------+
                | Announcements | announcements | 2025-02-15 19:39:13 |                         2 |                   1 |
                | Selling       | selling       | 2025-02-15 21:29:46 |                         4 |                   3 |
                | Buying        | buying        | NULL                |                      NULL |                NULL |
                | Trading       | trading       | NULL                |                      NULL |                NULL |
                | Discussions   | discussions   | 2025-02-16 09:57:13 |                         6 |                   2 |
                | Off-topic     | off-topic     | NULL                |                      NULL |                NULL |
                +---------------+---------------+---------------------+---------------------------+---------------------+

                Judging from the source code, I assume that the “last posted discussions” get updated whenever an other discussion is manipulated with (created, updated or deleted, etc…), that’s all I know. But either way, it is up to Flarum devs to determine the exact cause now and propose a fix, as I am pretty confident that what we have found is enough to assume the root cause reliably now

                  SKevo thank you for all your help! Glad we could at least figure out where the problem lies. I have allowed everyone to create discussions for now and hopefully the Flarum team will fix that bug soon 🙂

                  SKevo hey, just one more quick question. I have seen that you have given the Moderator permission alongside Admin to the main user – is that necessary or is there another reason behind it? Because I would remove it if it’s just the same, considering that Admin has permissions for everything. Thank you!

                    fragmart I apologize, no that’s not necessary and it was a typo from my side. I have removed the perms now, please check if all is in order now

                      SKevo no worries, I was just wondering if it makes any difference. Thanks!