mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-22 21:02:08 +08:00
Added null checks (#8511)
The added null checks manage properly importing definitions that do not contain the properties.
This commit is contained in:
committed by
GitHub
parent
d51418b2c1
commit
e771a56c42
@@ -137,8 +137,10 @@ namespace Orchard.Projections.Settings {
|
||||
var settings = part.Settings.GetModel<ProjectionPartSettings>();
|
||||
|
||||
// from identity part of the query and guid of the layout find reference
|
||||
settings.QueryLayoutRecordId = GetQueryLayoutRecord(settings.IdentityQueryLayoutRecord);
|
||||
settings.QueryLayoutRecordId = string.IsNullOrWhiteSpace(settings.IdentityQueryLayoutRecord)
|
||||
? "-1" : GetQueryLayoutRecord(settings.IdentityQueryLayoutRecord);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(settings.IdentityFilterQueryRecord)) {
|
||||
List<string> identityForFilterQuery = new List<string>();
|
||||
foreach (var record in settings.IdentityFilterQueryRecord.Split('&').ToList()) {
|
||||
var correctId = GetQueryLayoutRecord(record);
|
||||
@@ -147,6 +149,9 @@ namespace Orchard.Projections.Settings {
|
||||
}
|
||||
}
|
||||
settings.FilterQueryRecordId = string.Join("&", identityForFilterQuery);
|
||||
} else {
|
||||
settings.FilterQueryRecordId = string.Empty;
|
||||
}
|
||||
|
||||
_contentDefinitionManager.AlterTypeDefinition(context.ContentTypeDefinition.Name, cfg => cfg
|
||||
.WithPart(part.PartDefinition.Name,
|
||||
|
||||
Reference in New Issue
Block a user