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!
This implementation takes into account the message from private forums. Because the user cannot read private forum, he always have unread messages.
This version fixes the bug with counting private forums in the number of unread posts.
The count will be fixed for each user after the cache timeout.
Feel free to suggest further enhancements for the add-on or report any issues you have and they will be addressed asap.
Thank you!
FixedAddonsLab updated [AddonsLab] Unread Post Count with a new update entry:
Bug-fix: unread post count includes private forums
Read the rest of this update entry...
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}
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) "********"
}
}
This is a bug-fix version, that prevents a PHP error when uninstalling if the product "[AddonsLab] Navigation Badge" is not available (e.g. it was uninstalled first).
Suggestion: Provision for having fa-icon as badge. (left or right of the Menu text)
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.
Sorry for the confusion. I went ahead to debug by disabling all add ons and then checking by enabling one by one.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!
#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}
array(4) {
["url"] => string(1) "/"
["referrer"] => string(46) "https://url.tld/forums/internet-pc.25/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
The addon is spamming my php log with the following error:
Stack trace
- ErrorException: [E_NOTICE] Undefined index: unreadPostCountCache
- src/addons/AL/UnreadPostCount/Service/CounterService.php:124
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![]()
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...
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.
We use essential cookies to make this site work, and optional cookies to enhance your experience.