|
@@ -11,8 +11,6 @@ use Drupal\Core\Link;
|
|
use Drupal\Core\Url;
|
|
use Drupal\Core\Url;
|
|
use Drupal\flag\FlagService;
|
|
use Drupal\flag\FlagService;
|
|
use Drupal\comment\Entity\Comment;
|
|
use Drupal\comment\Entity\Comment;
|
|
-use Drupal\User\Entity\User;
|
|
|
|
-use Drupal\Flag\Entity\Flag;
|
|
|
|
use Drupal\Core\Datetime\DateFormatter;
|
|
use Drupal\Core\Datetime\DateFormatter;
|
|
use Drupal\file\Entity\File;
|
|
use Drupal\file\Entity\File;
|
|
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
|
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
|
@@ -125,8 +123,13 @@ class HeartbeatBlock extends BlockBase implements ContainerFactoryPluginInterfac
|
|
if (\Drupal::currentUser()->id() > 0) {
|
|
if (\Drupal::currentUser()->id() > 0) {
|
|
$myConfig = \Drupal::service('config.factory')->getEditable('heartbeat_feed.settings');
|
|
$myConfig = \Drupal::service('config.factory')->getEditable('heartbeat_feed.settings');
|
|
$friendData = \Drupal::config('heartbeat_friendship.settings')->get('data');
|
|
$friendData = \Drupal::config('heartbeat_friendship.settings')->get('data');
|
|
-
|
|
|
|
|
|
+ //TODO Use User IDs from friendData as conditions for heartbeats, rather than retrieving friendships in a separate query as is what follows in the lines ahead
|
|
$feed = $myConfig->get('message');
|
|
$feed = $myConfig->get('message');
|
|
|
|
+ if ($feed === null || $feed === 'null') {
|
|
|
|
+ $feed = "Public";
|
|
|
|
+ $myConfig->set('message', $feed)->save();
|
|
|
|
+ }
|
|
|
|
+
|
|
$uids = null;
|
|
$uids = null;
|
|
|
|
|
|
$query = Database::getConnection()->select('heartbeat_friendship', 'hf')
|
|
$query = Database::getConnection()->select('heartbeat_friendship', 'hf')
|
|
@@ -200,7 +203,7 @@ class HeartbeatBlock extends BlockBase implements ContainerFactoryPluginInterfac
|
|
$userPic = $user->get('user_picture')->getValue();
|
|
$userPic = $user->get('user_picture')->getValue();
|
|
|
|
|
|
if (!empty($userPic)) {
|
|
if (!empty($userPic)) {
|
|
- $profilePic = $user->get('user_picture')->getValue()[0]['target_id'];
|
|
|
|
|
|
+ $profilePic = $userPic[0]['target_id'];
|
|
}
|
|
}
|
|
|
|
|
|
if (NULL === $profilePic) {
|
|
if (NULL === $profilePic) {
|