Forums

Sender / Recipient not being displayed on PM's list page

CliosportOC 11 Jan, 2015
Hi all, me again!

As said previously, for the name display in our forum we use the Name field instead of Username. When this option is set, it is causing the sender/recipient name to not show up on the private message page.

When name display is set to 'username'
[attachment=0]Screen Shot 2015-01-11 at 22.26.14.png[/attachment]


When name display is set to 'Name'
[attachment=1]Screen Shot 2015-01-11 at 22.26.43.png[/attachment]

Kind regards

Tom
CliosportOC 11 Jan, 2015
Okay, I've fixed it myself, will post the fix up tomorrow!

Only issue is now it's not showing the user rank colour
CliosportOC 11 Jan, 2015
Edit: Seems I've not sorted it
CliosportOC 13 Jan, 2015
Answer
Okay, fixed it for the inbox & outbox. I changed line 89 in /com_chronoforums/chronoforums/controllers/messages.php from

		$this->Message->bindModels('belongsTo', array(
			'MessageUser' => array(
				'className' => '\GCore\Admin\Models\User',
				'foreignKey' => 'sender_id',
				'fields' => array('id', 'username'),
			),
		));


to

		$this->Message->bindModels('belongsTo', array(
			'MessageUser' => array(
				'className' => '\GCore\Admin\Models\User',
				'foreignKey' => 'sender_id',
				'fields' => array('id', 'name'),
			),
		));




And line 98 from
		$this->Message->MessageRecipient->bindModels('belongsTo', array(
			'MessageRecipientUser' => array(
				'className' => '\GCore\Admin\Models\User',
				'foreignKey' => 'recipient_id',
				'fields' => array('id', 'username'),
			),
		));


to

		$this->Message->MessageRecipient->bindModels('belongsTo', array(
			'MessageRecipientUser' => array(
				'className' => '\GCore\Admin\Models\User',
				'foreignKey' => 'recipient_id',
				'fields' => array('id', 'name'),
			),
		));
CliosportOC 13 Jan, 2015
[attachment=0]Screen Shot 2015-01-13 at 21.21.59.png[/attachment]


This might be worth including in the next update to automatically choose between 'name' and 'username' based on $fpramas display_name
This topic is locked and no more replies can be posted.