4
4
using System ;
5
5
using System . Collections . Generic ;
6
6
using System . Linq ;
7
+ using DotNetNuke . Entities . Modules ;
8
+ using DotNetNuke . Entities . Portals ;
7
9
using Satrabel . OpenContent . Components . Datasource . Search ;
8
10
using Satrabel . OpenContent . Components . Logging ;
9
11
using Satrabel . OpenContent . Components . Form ;
@@ -165,7 +167,7 @@ public virtual IDataItem GetData(DataSourceContext context, string scope, string
165
167
var json = dc . GetData ( scopeStorage , key ) ;
166
168
if ( json != null )
167
169
{
168
- var dataItem = new DefaultDataItem
170
+ var dataItem = new DefaultDataItem ( "" )
169
171
{
170
172
Data = json . Json . ToJObject ( "GetContent " + scope + "/" + key ) ,
171
173
CreatedByUserId = json . CreatedByUserId ,
@@ -304,8 +306,9 @@ public virtual void Update(DataSourceContext context, IDataItem item, JToken dat
304
306
ctrl . UpdateContent ( content ) ;
305
307
if ( context . Index )
306
308
{
309
+ var module = OpenContentModuleConfig . Create ( ModuleController . Instance . GetModule ( context . ModuleId , - 1 , false ) , new PortalSettings ( context . PortalId ) ) ;
307
310
var indexConfig = OpenContentUtils . GetIndexConfig ( new FolderUri ( context . TemplateFolder ) , context . Collection ) ;
308
- content . HydrateDefaultFields ( indexConfig ) ;
311
+ content . HydrateDefaultFields ( indexConfig , module . Settings ? . Manifest ? . UsePublishTime ?? false ) ;
309
312
LuceneController . Instance . Update ( content , indexConfig ) ;
310
313
LuceneController . Instance . Commit ( ) ;
311
314
}
@@ -353,7 +356,7 @@ public virtual JToken Action(DataSourceContext context, string action, IDataItem
353
356
{
354
357
if ( action == "FormSubmit" )
355
358
{
356
- if ( data [ "form" ] [ "approvalEnabled" ] != null && data [ "form" ] [ "approvalEnabled" ] . Value < bool > ( ) == true )
359
+ if ( data [ "form" ] [ "approvalEnabled" ] != null && data [ "form" ] [ "approvalEnabled" ] . Value < bool > ( ) == true )
357
360
{
358
361
data [ "form" ] [ "approved" ] = false ;
359
362
}
@@ -373,7 +376,7 @@ public virtual JToken Action(DataSourceContext context, string action, IDataItem
373
376
ctrl . AddContent ( content ) ;
374
377
375
378
//Index the content item
376
-
379
+
377
380
if ( context . Index )
378
381
{
379
382
var indexConfig = OpenContentUtils . GetIndexConfig ( new FolderUri ( context . TemplateFolder ) , "Submissions" ) ;
@@ -463,10 +466,8 @@ private static int GetTabId(DataSourceContext context)
463
466
464
467
private static DefaultDataItem CreateDefaultDataItem ( OpenContentInfo content )
465
468
{
466
- return new DefaultDataItem
469
+ return new DefaultDataItem ( content . Id )
467
470
{
468
- Id = content . Id ,
469
- Key = content . Key ,
470
471
Collection = content . Collection ,
471
472
Title = content . Title ,
472
473
Data = content . JsonAsJToken ,
0 commit comments