[AddonsLab] Unread Post Count

[AddonsLab] Unread Post Count 1.6.0

No permission to download
This implementation takes into account the message from private forums. Because the user cannot read private forum, he always have unread messages.

Thank you for the report. We are checking this and will provide the fix in coming hours.

Thank you!
 
  • InvalidArgumentException: Unknown relation NavigationBadge . src/XF/Mvc/Entity/Entity.php:382
Code:
Stack trace
#0 src/addons/AL/UnreadPostCount/Setup.php(49): XF\Mvc\Entity\Entity->getRelationOrDefault('NavigationBadge')
#1 src/XF/Admin/Controller/AddOn.php(492): AL\UnreadPostCount\Setup->uninstall(Array)
#2 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\AddOn->actionUninstall(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Uninstall', 'html', Object(XF\Mvc\ParameterBag), 'listAddOns', Object(XF\Admin\Controller\AddOn), NULL)
#4 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(1879): XF\Mvc\Dispatcher->run()
#6 src/XF.php(328): XF\App->run()
#7 admin.php(13): XF::runApp('XF\\Admin\\App')
#8 {main}

Code:
Request state
array(4) {
["url"] => string(57) "/community/admin.php?add-ons/AL-UnreadPostCount/uninstall"
["referrer"] => string(82) "https://www.caviaforum.nl/community/admin.php?add-ons/AL-UnreadPostCount/uninstall"
["_GET"] => array(1) {
["add-ons/AL-UnreadPostCount/uninstall"] => string(0) ""
}
["_POST"] => array(7) {
["_xfProcessing"] => string(1) "1"
["continue"] => string(1) "1"
["confirm"] => string(1) "1"
["params"] => string(2) "[]"
["count"] => string(1) "1"
["finished"] => string(1) "0"
["_xfToken"] => string(8) "********"
}
}
 
Hello, @Robru !

Thank you for the report. The issue is fixed and the update is released. Simply re-uploading product files and re-trying uninstallation should work.

Thank you!
 
Suggestion: Provision for having fa-icon as badge. (left or right of the Menu text)

Thank you for the suggestion. We will add it to Navigation Badge product, as that is the product responsible for showing the badge. We will implement the enhancement soon.

Thank you!
 
  • Like
Reactions: sip
There seems to be some problem wrt forum cache rebuild thru cron. One has to manually build it else the state doesn't change on new posts. The counter shows fine though.

Do you mean on new posts the number of unread posts is the same?
 
Do you mean on new posts the number of unread posts is the same?
Sorry for the confusion. I went ahead to debug by disabling all add ons and then checking by enabling one by one.

Issue turned out to be Q&A Add On from ThemeHouse.
Sorry again!
 
The addon is spamming my php log with the following error:
  • ErrorException: [E_NOTICE] Undefined index: unreadPostCountCache
  • src/addons/AL/UnreadPostCount/Service/CounterService.php:124
Stack trace
Code:
#0 src/addons/AL/UnreadPostCount/Service/CounterService.php(124): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/client...', 124, Array)
#1 src/addons/AL/UnreadPostCount/Service/CounterService.php(26): AL\UnreadPostCount\Service\CounterService->unreadCacheShouldUpdate(Array)
#2 src/addons/AL/UnreadPostCount/Callback.php(20): AL\UnreadPostCount\Service\CounterService->getCachedCount()
#3 [internal function]: AL\UnreadPostCount\Callback::getUnreadPostCount('whatsNew')
#4 src/addons/AL/NavigationBadge/Listener/NavigationSetup.php(49): call_user_func(Array, 'whatsNew')
#5 [internal function]: AL\NavigationBadge\Listener\NavigationSetup::listen(Object(XF\Pub\App), Array, Array)
#6 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#7 src/XF/App.php(2341): XF\Extension->fire('navigation_setu...', Array, NULL)
#8 src/XF/Pub/App.php(474): XF\App->fire('navigation_setu...', Array)
#9 src/XF/Pub/App.php(415): XF\Pub\App->getNavigation(Array, 'forums')
#10 src/XF/App.php(1715): XF\Pub\App->renderPageHtml('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#11 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#12 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#14 src/XF.php(328): XF\App->run()
#15 index.php(13): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state:
Code:
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(46) "https://url.tld/forums/internet-pc.25/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Don't know if it matters, i'm using the redis cache backend :)
 
The addon is spamming my php log with the following error:
  • ErrorException: [E_NOTICE] Undefined index: unreadPostCountCache
  • src/addons/AL/UnreadPostCount/Service/CounterService.php:124
Stack trace
Code:
#0 src/addons/AL/UnreadPostCount/Service/CounterService.php(124): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/client...', 124, Array)
#1 src/addons/AL/UnreadPostCount/Service/CounterService.php(26): AL\UnreadPostCount\Service\CounterService->unreadCacheShouldUpdate(Array)
#2 src/addons/AL/UnreadPostCount/Callback.php(20): AL\UnreadPostCount\Service\CounterService->getCachedCount()
#3 [internal function]: AL\UnreadPostCount\Callback::getUnreadPostCount('whatsNew')
#4 src/addons/AL/NavigationBadge/Listener/NavigationSetup.php(49): call_user_func(Array, 'whatsNew')
#5 [internal function]: AL\NavigationBadge\Listener\NavigationSetup::listen(Object(XF\Pub\App), Array, Array)
#6 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#7 src/XF/App.php(2341): XF\Extension->fire('navigation_setu...', Array, NULL)
#8 src/XF/Pub/App.php(474): XF\App->fire('navigation_setu...', Array)
#9 src/XF/Pub/App.php(415): XF\Pub\App->getNavigation(Array, 'forums')
#10 src/XF/App.php(1715): XF\Pub\App->renderPageHtml('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#11 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#12 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#14 src/XF.php(328): XF\App->run()
#15 index.php(13): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state:
Code:
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(46) "https://url.tld/forums/internet-pc.25/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Don't know if it matters, i'm using the redis cache backend :)

This is quite unusual as the error says the option of the product is not defined. This is a simple option added using the standard way of creating an option in Admin Panel, and should be located in Discussion Options page and called "Unread Post Count Cache (Minutes)". Please check if the option is there and save the page, in case the option is missing from some type of cache. Also, the error could happen if you have Navigation Badge add-on installed and configured to show unread post counts, but Unread Post Count add-on is uninstalled (so the files are there but the option no longer exists).

Please let us know if you still have the issue and we will check it one more time.

Thank you!
 
@AddonsLab Hmm, it looks like the error source was my other, test install of Xenforo + addons that was running on the same server that caused the errors... No errors for the last hours, looks okay :)
 
AddonsLab updated [AddonsLab] Unread Post Count with a new update entry:

New phrase controlling the counter

In this version, we have implemented a new phrase that controls the badge added. Phrase ID is "unread_post_counter" and by default, it only contains the counter variable, so after installation, the default behavior of the product does not change. However, the phrase can be edited to include any custom text or to remove the counter and replace with a phrase, like "New!".

Feel free to suggest further enhancements for the add-on or report any issues you have and they will be addressed asap...

Read the rest of this update entry...
 
SHO1.webp

Will this allow it to show up New! after any unread post in a thread? If so you rock man! When I get home today I am going to test it out.
 
View attachment 166249

Will this allow it to show up New! after any unread post in a thread? If so you rock man! When I get home today I am going to test it out.

Sorry, it seems we misunderstood your request. Now "New!" can be shown in the tab, instead of the number of unread posts. What you request is out of the scope of this add-on. Our add-on implements unread post counter, for users to see how many unread posts they have. What you request should be possible to implement using template edits or some other small add-on. Unfortunately, we can't assist you with that as we are very busy with several large projects now.

Thank you!
 
Top Bottom