Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 12 2020 01:41

    jtkech on patch-1

    (compare)

  • Apr 12 2020 01:39

    jtkech on patch-1

    Update ZoneShapes.cs (compare)

somecodeguy
@dafergu2:matrix.org
[m]
I had to jump through a bunch of hoops to work around this because in a non-dev environment, the css style name is hashed due to bundling and I dynamically get the url from a manifest. So I ended up having to regex sub a bunch of filename patterns and hope I don't get conflicts. On top of that, in dev mode the css is being imported via an HMR transpiled component that doesn't actually use the manifest. So I had to create a liquid accessor that exposed whether or not I was in dev mode in order to manually render the stylesheet a vue subcomponent used when in a non-dev environment but use the HMR on the fly transpiled version when in dev.
Does anyone know if script resources can depend on css resources? And if so, what might cause my specific situation of them not rendering?
Dean Marcussen
@deanmarcussen
Scripts dependencies and style dependencies are seperate, so there's no dependencies between them
somecodeguy
@dafergu2:matrix.org
[m]
Hrm, why differentiate?
Use case is I'm pulling in a package and bundling the css. The package may need you to import css in your js code, which results in a new css file being bundled. I'm using the bundle manifest to determine what script resources are needed for a given entry point. It cascades down to the css files as well. Since the script is the entry point, that's the only file that is truly deterministic in naming.
aaronamm
@aaronamm

For those who what to use GitHub Actions or Azure DevOps Pipelines, I have a document to compare them.
I will add GitHub Actions code specific to Orchard Core later.

https://www.dotnetthailand.com/programming-cookbook/github-actions/github-actions-vs-azure-devops-pipelines

Sotiris Roussos
@urbanit
Trumbowyg editor error during image resizing: https://jsfiddle.net/sroussos/rmv1e0ja/2/
4 replies
Sotiris Roussos
@urbanit
image.png
somecodeguy
@dafergu2:matrix.org
[m]
If got a custom controller with a route. It's job is to grab a well known content item, add a property to it based on a url parameter, and then render the shape.
        [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);
        }
When I look at the Model in the rendered template, the model doesn't have the property. Is there some configuration I need to add?
Also, all of a sudden our media library isn't populating. What's the best way to debug? We use the Azure storage provider.
@deanmarcussen: Isn't that the pattern you recommended to me rather than using the content item merge?
somecodeguy
@dafergu2:matrix.org
[m]
I'm also seeing this in the logs:
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
full disclosure, running on .net 6 prev 4
Dean Marcussen
@deanmarcussen
can you open an issuie for the second one (or I will never remember to see if its a problem, and I think it might be something to look at)
somecodeguy
@dafergu2:matrix.org
[m]
@deanmarcussen: Yup, I believe it is prev 4 related. prev 3 works.
2 replies
Dean Marcussen
@deanmarcussen
re the first, it dependes which Model in which template probably, where you are looking for the property
somecodeguy
@dafergu2:matrix.org
[m]
so, I have a liquid page with an alias. The liquid page has nothing on it really, except a flow part and a liquid part (body). I have a {{ 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.
Dean Marcussen
@deanmarcussen
they don't automatically apply to the shapes inside a shape. so it will be at the parent View. So whatever View you return from that controller, and if you need it lower, you need to pass it further down. or cheat and stick it in the http context.
1 reply
somecodeguy
@dafergu2:matrix.org
[m]
got an example of cheating with the http context?
somecodeguy
@dafergu2:matrix.org
[m]
@deanmarcussen: OrchardCMS/OrchardCore#9604
Brent
@fuzl-llc
Using the default Blog recipe, I'm trying to write a Lucene query to return BlogPost content items that have the Category "Travel" taxonomy checked. I've searched everywhere and can't find anything on searching for content items that have a particular taxonomy item (or items) selected. I found one thing here that doesn't seem to work for me: putting "term": { "BlogPost.Category": "47d0np1jrbb17t22xn8hm0bsw5" } after the query/term part of the built in RecentBlogPosts query. Is there a way to make this work?
2 replies
somecodeguy
@dafergu2:matrix.org
[m]
@fuzl-llc: Sorry mate, haven't worked with Lucene stuff yet.
Mike Paterson
@devlife
I enabled graphql feature but i don't see anything in the schema. any ideas?
1 reply
Actually it looks like this is being thrown
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,
somecodeguy
@dafergu2:matrix.org
[m]
@deanmarcussen: I got the httpcontext working, thanks! It wouldn't be my first choice of how to get it to work, but it works. I tried adding an alternate to the shape but it seemed like it was ignored (the Model in the rendered page did not have the alternate listed) hence why I went with the httpcontext approach. Thanks again.
Dean Marcussen
@deanmarcussen
@devlife upgrade :) that’s fixed
1 reply
Mike Paterson
@devlife
ok thanks dean
@deanmarcussen i might now have time to do that right this minute. it works in staging but not in prod. can you point me to the underlying issue?
Dean Marcussen
@deanmarcussen
There will be a content part with a duplicate field name. You’d have to configure the graphql options to collapse it probably
Mike Paterson
@devlife
Ah interesting! i'll look into that. thanks!
Mike Paterson
@devlife
@deanmarcussen that doesn't appear to be the case. unless i'm just missing it, i don't see a duplicate.
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: Can you remind me where to find the flowpart percentage setup? I want to try and fix it for tailwind.
Brent
@fuzl-llc

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?

aaronamm
@aaronamm
Does any body know why script at does not work?
I am trying to add <script asp-name="bootstrap" at="Foot"></script> to my layout.cshtml for my custom theme.
Then, the script does not render at root of HTML page.
After I have remote at="Footer", it works.
Setting at="Head" does not render as well.
I would be glad if someone can help me for this.
Thanks
The admin works but I don't know why it does not work for my custom theme.
image.png
aaronamm
@aaronamm
Good start, the default theme work.
image.png
aaronamm
@aaronamm
Got it work by using a default theme but can't get it work with a custom theme from dotnet new octheme -n "ThemeName.OrchardCore"
aaronamm
@aaronamm
It is possible that disable/enable theme fix the issue but I am not 100% but right now a custom theme that I made from dotnet new octheme work.
4 replies
Aleksey Filippov
@happygrizzly
Hi there everyone!
Can you plese advise a development routine using webpack for a separate module / theme.
So far I have created a separate theme project, referenced it in the main CMS project. Theme project contains a webpack configuration. The production configuration is more understandable for me. I'm not sure how to do it with when in development?
My motivation is to use picked modules / scss from bootstrap npm package.
I also added purgecss to my development webpack config.
And I was going to use LiveReloadPlugin
so I could put a dev / livereload server's url to Orchard's resource manifest
Aleksey Filippov
@happygrizzly
as a development script
Aleksey Filippov
@happygrizzly
I'm not sure about PurgeCss and the Views paths. I'm not sure if purgecss will process paths to the cshtml / liquid views properly. In the theme project, in the postcss.config.js I define the paths patterns as './Views/**/.cshtml' and ./Views/\*/*.liquid' accordingly.
somecodeguy
@dafergu2:matrix.org
[m]
@happygrizzly: I JUST finished integrating vite into my development/prod build workflow. It'd be pretty similar. My motivation for using vite versus webpack was that 1) I'm using vue to create reactive content on my site and vite works well with Vue out of the box and 2) it uses rollup under the hood to package and bundle scripts. Rollup is a little easier to deal with building multiple bundles (each of my content item vue components would be its own entry point).