File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,24 @@ export class AddonModForumPrefetchHandler extends CoreCourseActivityPrefetchHand
122122 } ) ;
123123 } ) ;
124124
125- return Promise . all ( promises ) ;
125+ return Promise . all ( promises ) . then ( ( results ) => {
126+ // Each order has returned its own list of posts. Merge all the lists, preventing duplicates.
127+ const posts = [ ] ,
128+ postIds = { } ; // To make the array unique.
129+
130+ results . forEach ( ( orderResults ) => {
131+ orderResults . forEach ( ( orderResult ) => {
132+ orderResult . posts . forEach ( ( post ) => {
133+ if ( ! postIds [ post . id ] ) {
134+ postIds [ post . id ] = true ;
135+ posts . push ( post ) ;
136+ }
137+ } ) ;
138+ } ) ;
139+ } ) ;
140+
141+ return posts ;
142+ } ) ;
126143 }
127144
128145 /**
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export class AddonModGlossaryEditPage implements OnInit {
8888 if ( entry ) {
8989 this . entry . concept = entry . concept || '' ;
9090 this . entry . definition = entry . definition || '' ;
91+ this . entry . timecreated = entry . timecreated || 0 ;
9192
9293 this . originalData = {
9394 concept : this . entry . concept ,
You can’t perform that action at this time.
0 commit comments