I have a comments form and Manual Approval is set to true in settings
The records are being added to the database as 'Submitted' not 'Approved' but they are still appearing on the page using .GetApprovedRecordsFromPage
Here is the code:
@using Umbraco.Forms.Mvc.DynamicObjects
<ul>
@foreach (dynamic record in Library
.GetApprovedRecordsFromPage(@CurrentPage.Id).OrderBy("Created"))
{
<li>
@record.Created.ToString("dd MMMM yyy")
<strong>@record.Name</strong>
<span>said</span>
<p>@record.Comment</p>
</li>
}
</ul>
CS1061: 'Umbraco.Web.UmbracoHelper' does not contain a definition for 'Forms' and no extension method 'Forms' accepting a first argument of type 'Umbraco.Web.UmbracoHelper' could be found (are you missing a using directive or an assembly reference?)
GetApprovedRecordsFromPage not working
Hi I'm using Umbraco 7.1.4 and Contour 3.0.21
I have a comments form and Manual Approval is set to true in settings The records are being added to the database as 'Submitted' not 'Approved' but they are still appearing on the page using .GetApprovedRecordsFromPage
Here is the code:
Thanks
Can anyone help with this? The comment functionality is the reason we paid for this package but it's no good if we can't only show approved comments.
Thanks
Comment author was deleted
Sounds like a bug, looking into it, eta for a fix early next week
Comment author was deleted
As a temp workaround you can filter on state in your code since the record has a State property
Comment author was deleted
so add if(record.State = Umbraco.Forms.Core.Enums.Approved)
Thanks Tim,
I'm getting this error with the work around:
CS1061: 'Umbraco.Web.UmbracoHelper' does not contain a definition for 'Forms' and no extension method 'Forms' accepting a first argument of type 'Umbraco.Web.UmbracoHelper' could be found (are you missing a using directive or an assembly reference?)
The full code is:
What am I missing? Cheers!
Comment author was deleted
try adding using statement
using Umbraco.Forms.Core.Enums;
and then is should be
Cheers Tim,
That worked, will you post back when there is fix to the .GetApprovedRecordsFromPage?
Ta
Comment author was deleted
Ah glad that workaround did the trick, will do!
Comment author was deleted
Looking into the bug now, just been able to reproduce
Also have the bug where GetApprovedRecordsFromPage returns all records
Comment author was deleted
Bug is fixed and will be part of a 3.0.22 release coming shortly
Great, Thanks Tim :)
is working on a reply...