Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I send a message to all the users in a role, unfortunately no Growl notification is shown. I think the problem is in the pmgrowl_sql_unclosed() function. I made some changes to this function and now it works. I don't know if it's a problem to show messages of the type hidden :-)
function pmgrowl_sql_unclosed($account) {
// Set the primary table.
$query = db_select('pm_index', 'pmi')
->fields('pmi', array('mid'))
->condition('pmi.recipient', $account->uid)
// ->condition('pmi.type', array('user', 'type')) <-- removed
->condition('pmi.type', array('user', 'type', 'hidden')) // <-- added
->condition('pmi.is_new', 1)
->condition('pmi.deleted', 0)
->groupBy('pmi.mid')
->orderBy('pm.timestamp', 'ASC');
$query->join('pm_message', 'pm', 'pm.mid = pmi.mid');
// Select only messages that are not already closed.
$deleted = db_select('pmgrowl_close', 'pmg')
->fields('pmg', array('mid'))
->condition('pmg.uid', $account->uid)
->condition('pmg.closed', 1);
$query->condition('pmi.mid', $deleted, 'NOT IN');
return $query;
}
Comments
Comment #1
kmare CreditAttribution: kmare commentedwell, I don't know as well if it's the proper solution adding the hidden parameter, but it looks like it's working for me. So thanks a lot, voskuh! :)