mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fix bug field index part handler (#8294)
This commit is contained in:
parent
70c4541977
commit
a67b3cfa00
@ -48,7 +48,10 @@ namespace Orchard.Projections.Handlers {
|
||||
}
|
||||
}
|
||||
private void Updated(UpdateContentContext context, FieldIndexPart fieldIndexPart) {
|
||||
if (context.UpdatingItemVersionRecord.Latest) { // updates projection draft indexes only if it is the latest version
|
||||
// there are two different item types: saved in memory and saved to db
|
||||
// those saved in memory don't have correctly the populated record and this generate NullReferenceException
|
||||
if (context.UpdatingItemVersionRecord != null && context.UpdatingItemVersionRecord.Latest) {
|
||||
// updates projection draft indexes only if it is the latest version
|
||||
DescribeValuesToindex(fieldIndexPart, (indexServiceContext) => {
|
||||
_draftFieldIndexService.Set(fieldIndexPart,
|
||||
indexServiceContext.LocalPart.PartDefinition.Name,
|
||||
@ -113,4 +116,4 @@ namespace Orchard.Projections.Handlers {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user