User tests: Successful: Unsuccessful:
Pull Request for Issue #26895 .
fix
Login to Joomla admin with one user
Go to the private message section.
Add another user Id in recipients
Add some context and send the message.
Now login with another user.
See the admin panel
badge
no badge
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration |
I have tested this item
Now the messages appear in the list view. However, the notification count does not change even after I read the messages
I have tested this item
I agree with @thite-amol and modify my test
looks like getitems will get all items pertaining to the user whatever the state of the message. It works in the Messages manager because we have filters, but not for the module
I get it to work by using the query we had in J3
diff --git a/administrator/modules/mod_messages/mod_messages.php b/administrator/modules/mod_messages/mod_messages.php
index 1a346ed..b53a2a7 100644
--- a/administrator/modules/mod_messages/mod_messages.php
+++ b/administrator/modules/mod_messages/mod_messages.php
@@ -10,5 +10,19 @@
defined('_JEXEC') or die;
+use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ModuleHelper;
+// Get the number of unread messages in your inbox.
+$db = Factory::getDbo();
+$user = Factory::getUser();
+
+$query = $db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__messages')
+ ->where('state = 0 AND user_id_to = ' . (int) $user->get('id'));
+
+$db->setQuery($query);
+
+$countUnread = (int) $db->loadResult();
+
require ModuleHelper::getLayoutPath('mod_messages', $params->get('layout', 'default'));
diff --git a/administrator/modules/mod_messages/tmpl/default.php b/administrator/modules/mod_messages/tmpl/default.php
index ec0fa3a..00bda51 100644
--- a/administrator/modules/mod_messages/tmpl/default.php
+++ b/administrator/modules/mod_messages/tmpl/default.php
@@ -27,5 +27,4 @@
<?php echo Text::_('MOD_MESSAGES_PRIVATE_MESSAGES'); ?>
</div>
- <?php $countUnread = $app->getSession()->get('messages.unread'); ?>
<?php if ($countUnread > 0) : ?>
<span class="badge badge-pill badge-danger"><?php echo $countUnread; ?></span>
Labels |
Added:
?
|
@infograf768, @thite-amol please retest
I have tested this item
I have tested this item
Followed testing instructions.
Notifications appeared when patch was applied. Not before.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
I have tested this item
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-16 07:41:53 |
Closed_By | ⇒ | infograf768 |
tks
I have tested this item✅ successfully on eb4387b
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26912.