- 🇳🇴Norway hansfn
This is only D7 issue I might actually fix, if it is still an issue with version 7.x-1.6. Please confirm.
This code not work if enabled the entity api
// Global token replacement, and node/user token replacements
// if a nid/uid is found in the views result row.
$data = array();
if (property_exists($view->result[$row_id], 'uid')) {
$data['user'] = user_load($view->result[$row_id]->uid);
}
if (property_exists($view->result[$row_id], 'nid')) {
$data['node'] = node_load($view->result[$row_id]->nid);
}
stdClass Object has a different structure
<?
stdClass Object
(
[entity] => 775
[_entity_properties] => Array
(
[search_api_relevance] => 1
[search_api_excerpt] =>
[uid] => 775
[entity object] => stdClass Object
(
[uid] => 775
[name] => oplant_775
[pass] =>t$S$W9L.Cve5hicKdrOgYLaS1MkGdknz
[mail] => plant@gmail.com
[theme] =>
[signature] =>
[signature_format] => plain_text
[created] => 1461003783
[access] => 0
[login] => 0
[status] => 1
[timezone] => Europe/Moscow
[language] => ru
[picture] => 0
[init] => plant@gmail.com
[data] =>
[roles] => Array
(
[2] => authenticated user
[3] => firstgroup
)
)
[mail] => plant@gmail.com
[edit_url] => http://dev.site/user/775/edit
)
[_field_data] => Array
(
[field_reg_kontaktnoe_lico] => Array
(
[entity_type] => user
[entity] => stdClass Object
(
[uid] => 775
[name] => oplant_775
[pass] =>
t$S$W9L.Cve5hicKdrOgYLaS1MkGdknz
[mail] => plant@gmail.com
[theme] =>
[signature] =>
[signature_format] => plain_text
[created] => 1461003783
[access] => 0
[login] => 0
[status] => 1
[timezone] => Europe/Moscow
[language] => ru
[picture] => 0
[init] => plant@gmail.com
[data] =>
[roles] => Array
(
[2] => authenticated user
[3] => firstgroup
)
)
)
)
.... more
I've done this and it helped
$data['user'] = user_load($view->result[$row_id]->entity);
Add the code as correct, please. I'm not a programmer )
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This is only D7 issue I might actually fix, if it is still an issue with version 7.x-1.6. Please confirm.