[Route("{myValue?}")]
public async Task<IActionResult> ClassDetails(int myValue)
{
var page = await _oc.GetContentItemByHandleAsync($"slug:/class");
var shape = await _displayManager.BuildDisplayAsync(page, _modelAccessor.ModelUpdater);
shape.Properties.Add("TestPropertly", myValue);
// var content = await _displayHelper.ShapeExecuteAsync(shape);
return View(shape);
}
2021-06-02 12:07:56.9398|Default|00-521add71d6b10e8fa1df420ac31f8e49-aee88540b26e97b6-00||Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.
at System.DateTime.ToFileTimeUtc() in System.Private.CoreLib.dll:token 0x6000ccc+0x45
at System.DateTimeOffset.ToFileTime() in System.Private.CoreLib.dll:token 0x6000d41+0x7
at SixLabors.ImageSharp.Web.Middleware.ImageContext.ComputeLastModified() in SixLabors.ImageSharp.Web.dll:token 0x60000c3+0x60
at SixLabors.ImageSharp.Web.Middleware.ImageContext.ComprehendRequestHeaders(DateTimeOffset lastModified, Int64 length) in SixLabors.ImageSharp.Web.dll:token 0x60000bc+0xe
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.SendResponseAsync(ImageContext imageContext, String key, ImageCacheMetadata metadata, IImageCacheResolver cacheResolver) in SixLabors.ImageSharp.Web.dll:token 0x60000d1+0x28
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext context, IImageResolver sourceImageResolver, ImageContext imageContext, IDictionary`2 commands) in SixLabors.ImageSharp.Web.dll:token 0x60000ce+0x2fb
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context) in SixLabors.ImageSharp.Web.dll:token 0x60000cd+0x381
at OrchardCore.Media.Services.MediaFileStoreResolverMiddleware.Invoke(HttpContext context) in OrchardCore.Media.dll:token 0x6000106+0x45d
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) in Microsoft.AspNetCore.Authorization.Policy.dll:token 0x600000b+0x3f1
{{ Model | json }}
in the body liquid part and in a liquid part in the flow part. Neither of them have anything in the properties field.
"term": { "BlogPost.Category": "47d0np1jrbb17t22xn8hm0bsw5" }
after the query/term part of the built in RecentBlogPosts query. Is there a way to make this work?
System.ArgumentOutOfRangeException:
at GraphQL.Types.ComplexGraphType`1.AddField (GraphQL, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null)
at OrchardCore.Queries.Lucene.GraphQL.Queries.LuceneQueryFieldTypeProvider+<BuildAsync>d__2.MoveNext (OrchardCore.Lucene, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullOrchardCore.Lucene, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Lucene\GraphQL\LuceneQueryFieldTypeProvider.csOrchardCore.Lucene, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 53)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at OrchardCore.Apis.GraphQL.Services.SchemaService+<GetSchemaAsync>d__5.MoveNext (OrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullOrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Apis.GraphQL\Services\SchemaService.csOrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 56)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at OrchardCore.Apis.GraphQL.GraphQLMiddleware+<ExecuteAsync>d__9.MoveNext (OrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullOrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Apis.GraphQL\GraphQLMiddleware.csOrchardCore.Apis.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 78)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0,
I can't figure out if this is a bug or me not understanding... I have a "Location" content type and a "Locations" taxonomy with the "Term Content Type" set to the "Location" content type. I also have a Lucene query for a "Location" content type:
Schema:
{
"type": "ContentItem/Location"
}
Query:
{
"query": {
"term": { "Content.ContentItem.ContentType": "Location" }
}
}
I add two content items: a location "Location 1" using the "Content > Content Items > New > Location" menu item and "Location 2" using the "Content > Content Items > Locations > Add Location" button (i.e. from within the "Edit Taxonomy" page of the "Locations" taxonomy). If I run the query above, it only shows "Location 1" even though they are both Location content types.
Any ideas on what the difference is between content items added directly vs those that are added from within a taxonomy that would make the query find/not find them? Can the query be modified to find those that were created from inside the taxonomy?
script at
does not work?<script asp-name="bootstrap" at="Foot"></script>
to my layout.cshtml for my custom theme.ResourceManagementOptionsConfiguration
class in your theme. You'll need to dynamically determine the actual Url of the file based on whether or not your in development mode. In my case, the production built files end up in wwwroot/dist/*.<filehash>.{js|css}
. Vite generates a manifest file that indicates the resulting bundled file names based on the original file location. I parse that and use that data to determine the actual file name and url of the resource when it is in production. When in development, I use the original file name and location as the url since I am using the vite's HMR dev server for live reload.
Startup.cs
I have the following:
if (env.IsDevelopment())
{
...
app.UseViteDevelopmentEnvironment();
}
public static IApplicationBuilder UseViteDevelopmentEnvironment(
this IApplicationBuilder builder)
{
// Use the vite dev server as a proxy for all of the ts or css files
return builder.MapWhen(context => IsViteResource(context), builder =>
{
builder.Use(async (context, next) =>
{
var oldUrl = (string)context.Request.Path;
// Patch the hmr client. It doesn't respect the base url path in the
// vite config. There is an outstanding PR to fix this in the vite repo.
// https://github.com/vitejs/vite/pull/3495
if (oldUrl.EndsWith("@vite/client"))
{
var newUrl = oldUrl.Replace("@vite/client", "patches/vite-hmr-client.js");
context.Request.Path = newUrl;
context.Request.QueryString = new QueryString("");
}
await next();
});
builder.UseSpa(spa =>
{
// TODO: Make this configurable if needed. We would also need to make the vite
// server configurable as well.
spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");
});
});
}
private static bool IsViteResource(HttpContext context)
{
var url = (string)context.Request.Path;
var lowerUrl = url.ToLowerInvariant();
if (lowerUrl.Contains("firefliestheme")
&& (lowerUrl.EndsWith(".ts")
|| lowerUrl.EndsWith(".js")
|| lowerUrl.EndsWith(".css")
|| lowerUrl.EndsWith(".pcss")
|| lowerUrl.EndsWith(".vue")
|| lowerUrl.Contains("@vite"))
|| lowerUrl.Contains("/vite/")
|| lowerUrl.Contains("node_modules")
// TODO: Once we figure out how to deal
// with the bug in the vite HMR client, determine if we
// should filter based on the /dist/ folder
// && !lowerUrl.Contains("/dist/")
)
{
return true;
}
return false;
}
firefliestheme
in the code, that's the name of my theme module.