Skip to content

Commit

Permalink
Fixing Queried Content Items query validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone authored Dec 5, 2024
1 parent 177dc30 commit 88edd3e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected override async Task ProcessAsync(QueryBasedContentDeploymentStep step,
return;
}

if (!query.CanReturnContentItems || !query.ReturnContentItems)
if (!query.ReturnContentItems)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ await context.Updater.TryUpdateModelAsync(queryBasedContentViewModel, Prefix,

var query = await _queryManager.GetQueryAsync(queryBasedContentViewModel.QueryName);

if (!query.CanReturnContentItems || !query.ReturnContentItems)
if (!query.ReturnContentItems)
{
context.Updater.ModelState.AddModelError(Prefix, nameof(step.QueryName), S["Your Query is not returning content items."]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ private static Task UpdateQueryAsync(DataQueryContextBase context)
context.Query.Put(metadata);
};

context.Query.CanReturnContentItems = true;

return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ private static Task UpdateQueryAsync(DataQueryContextBase context)
context.Query.Put(metadata);
}

context.Query.CanReturnContentItems = true;

return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
using OrchardCore.Entities;

namespace OrchardCore.Queries;
Expand All @@ -24,8 +23,5 @@ public class Query : Entity
/// </summary>
public string Schema { get; set; }

[JsonIgnore]
public bool CanReturnContentItems { get; set; }

public bool ReturnContentItems { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ private static Task UpdateQueryAsync(DataQueryContextBase context)
context.Query.Put(metadata);
}

context.Query.CanReturnContentItems = true;

return Task.CompletedTask;
}
}

0 comments on commit 88edd3e

Please sign in to comment.