summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcambra2013-06-04 18:13:58 (GMT)
committer Juampy2013-06-04 18:13:58 (GMT)
commit63a510dc56a2ba64b242d451411e1b3f0086b2e1 (patch)
tree4e69a75133f0b14dacf560269f1c05d99c9041f0
parentbe51ebfa07ed41fc14d58438b27ea15afbbdfd20 (diff)
Issue #2011932 by pcambra: [Drupal 8] Update Entity & field rendering hooks.
-rw-r--r--twitter.module7
1 files changed, 3 insertions, 4 deletions
diff --git a/twitter.module b/twitter.module
index 9dae9fb..894930d 100644
--- a/twitter.module
+++ b/twitter.module
@@ -378,13 +378,12 @@ function twitter_user_delete($account) {
*
* Adds Twitter account information to the user profile.
*/
-function twitter_user_view_alter(&$build) {
- $user = $build['#account'];
- if (!empty($user->twitter_accounts)) {
+function twitter_user_view_alter(&$build, \Drupal\user\Plugin\Core\Entity\User $account, \Drupal\entity\Plugin\Core\Entity\EntityDisplay $display) {
+ if (!empty($account->twitter_accounts)) {
$build['twitter'] = array(
'#type' => 'user_profile_item',
'#title' => t('Twitter accounts'),
- '#markup' => theme('twitter_user_accounts', array('accounts' => $user->twitter_accounts)),
+ '#markup' => theme('twitter_user_accounts', array('accounts' => $account->twitter_accounts)),
'#weight' => 10,
);
}