Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Whats the use of database.php
In database.php i have this
$DatabaseColumns['Discussion']['Draft'] = 'Draft';
Now when i do
I do not see the Drafts field in it. I thought the whole idea of database.php file so when I use $Row it pulls all the field names added by the extensions. Looks like it only pulls up the default ones like Active, Closed etc.
I know i can make a query to get the drafts field, but it should be pulled by default if I'm working with DiscussionGrid
The GetDiscussionBuilder function should pull all the fields in the row. right now it pulls a predefined fields
$DatabaseColumns['Discussion']['Draft'] = 'Draft';
Now when i do
$this->DiscussionData = $DiscussionManager->GetDiscussionList($this->Context->Configuration['BLOG_PER_PAGE'], $this->CurrentPage, $this->Context->Configuration['BLOG_CATEGORY_ID']);
while ($Row = $this->Context->Database->GetRow($this->DiscussionData)) {
//Row contains the dataset
}
I do not see the Drafts field in it. I thought the whole idea of database.php file so when I use $Row it pulls all the field names added by the extensions. Looks like it only pulls up the default ones like Active, Closed etc.
I know i can make a query to get the drafts field, but it should be pulled by default if I'm working with DiscussionGrid
The GetDiscussionBuilder function should pull all the fields in the row. right now it pulls a predefined fields
0
This discussion has been closed.
Comments
GetDiscussionBuilder just grabs the set of fields that most other functions need, and joins the tables to make it a bit easier than starting a SQLBuilder by scratch.
function DiscussionManager_ShowDraft(&$DiscussionManager) { $s = &$DiscussionManager->DelegateParameters['SqlBuilder']; $s->AddWhere('t', 'Draft', '', '1', '='); } $Context->AddToDelegate("DiscussionManager","PostGetDiscussionBuilder","DiscussionManager_ShowDraft"); $Context->AddToDelegate("DiscussionManager","PreGetDiscussionCount","DiscussionManager_ShowDraft");
So the drafts are picked correctly and it all works as expected. So if I want to display only draft posts it does exactly that. what i was hoping is that I would be able to use $Discussion->Draft to do additional checks. But that parameter doesn't exist in the $Discussion Object. Every Discussion should have the Draft parameter like it has the closed or active parameter.