Permalink
Browse files

fix(likes): notification subject too long

In some use cases the subject of the notification could be very long
(eg. comments)

fixes: #8906
  • Loading branch information...
jeabakker committed Oct 11, 2016
1 parent be3415d commit fc5667dcf83887b6a35d45bac91512ca58999843
Showing with 12 additions and 1 deletion.
  1. +12 −1 mod/likes/actions/likes/add.php
@@ -46,11 +46,21 @@
$title_str = $entity->getDisplayName();
if (!$title_str) {
$title_str = elgg_get_excerpt($entity->description);
$title_str = elgg_get_excerpt($entity->description, 80);
}
$site = elgg_get_site_entity();
// summary for site_notifications
$summary = elgg_echo('likes:notifications:subject', array(
$user->name,
$title_str
),
$owner->language
);
// prevent long subjects in mail
$title_str = elgg_get_excerpt($title_str, 80);
$subject = elgg_echo('likes:notifications:subject', array(
$user->name,
$title_str
@@ -77,6 +87,7 @@
array(
'action' => 'create',
'object' => $annotation,
'summary' => $summary,
)
);
}

0 comments on commit fc5667d

Please sign in to comment.