HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Problem implementing /vanilla/views/discussion/discussion.php
R_J
Admin
I've created a plugin and wanted to render a discussion with help of the standard discussion view. I'm using Vanilla 2.1, default theme and have disabled every plugin. But I always get only a part of the expected result.
This is the code I use:
public function PluginController_TestView_Create($Sender, $Args) { $DiscussionID = $Args[0]; $DiscussionModel = new DiscussionModel(); $Discussion = $DiscussionModel->GetID($DiscussionID); $Sender->SetData('Discussion', $Discussion); $Sender->Render($Sender->FetchViewLocation('discussion', 'Discussion', 'Vanilla'));
And that is the HTML I get in return
< div id="Discussion_2" class="Item ItemDiscussion"> < div class="Discussion"> < div class="Item-Header DiscussionHeader"> < div class="AuthorWrap"> < span class="Author"> < a title="Moe" href="/forum/profile/4/Moe" class="PhotoWrap">< img src="http://wd.vanillicon.com/d355bc8c2ea95365ea9b23860e5ad39f_50.png" alt="Moe" class="ProfilePhoto ProfilePhotoMedium" />< /a>< a href="/forum/profile/4/Moe" class="Username">Moe< /a>
I've already tried DiscussionController instead of PluginController but that had no impact, the result has been the same.
Rendering seems to stop at echo FormatMeAction($Discussion);
but I cannot find a reason for that. Does anyone has an idea what could be the problem here?
0
Answers
Tried to print out a comment:
That was no problem at all...
Solved my problem: FormatMeAction is defined in discussion helper_functions and I haven't included that before rendering discussion view. That's all...