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)

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).
PurrgeCSS is working fine scanning our liquid and cshtml files
So, the main points. If you can get webpack bundling your resources properly, you'll have two different paths to get things working. 1) How do you register your scripts and stylesheets properly with a released version of your site, and 2) How do you use the same registration to redirect to a different file name when running in development mode.
I'm planning on writing a detailed blog post about it. It really has made a huge difference in our development inner loop and made things more efficient.
somecodeguy
@dafergu2:matrix.org
[m]
But a quick synopsis. 1) You'll need to register your stylesheets and scripts using the 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.
When in development, I register a proxy for all of the resources vite would be bundling for me. So, in my Startup.cs I have the following:
if (env.IsDevelopment())
{
    ...
    app.UseViteDevelopmentEnvironment();
}
and that method looks like this...
somecodeguy
@dafergu2:matrix.org
[m]
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;
}
The above startup code is your web project, not your theme project. Also, the mention to firefliestheme in the code, that's the name of my theme module.
You also need to reference this package in your main web project. <PackageReference Include="Microsoft.Aspnetcore.SpaServices.Extensions" Version="5.0.6" />
somecodeguy
@dafergu2:matrix.org
[m]
MS does have a package that is webpack specific. I wouldn't advise using it though, even though a lot of blogs show that you should. The reason is that it is now deprecated. MS is now recommending that for a true spa, you use the development server of webpack/react/angular/vue/whatever and then have it proxy all calls it doesn't server to your dotnet process. That doesn't work well here, and they are still supporting the generic proxy api (that I use above) from the Microsoft.Aspnetcore.SpaServices.Extensions package
somecodeguy
@dafergu2:matrix.org
[m]
@happygrizzly: I hope all of the above I posted helps. I spent a good amount of time getting this to work over the past several weeks. The end result is that I can use full vue SFC components, typescript, and 3rd party packaged js components easily now. All of my JS is now in typescript as well.
4 replies
Aleksey Filippov
@happygrizzly
Thank you very much! I'm going to investigate this. In my case I don't need a spa. Considering my requirements it would be easier to go with next.js as a separate frontend project. But - believe it or not - company doesn't like the idea of node/next.js.
3 replies
Sébastien Ros
@sebastienros
@deanmarcussen @Skrypt @agriffard won't be able to join the triage until 10:15 PT (15 minutes late)
What is Dave's alias so he's aware?
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: Do you mean me?
I'm guessing not. :)
Dean Marcussen
@deanmarcussen
@sebastienros I can't make it all tonight :( Dave was daveblack, but he has changed his name I think, optimal?
Antoine Griffard
@agriffard
Dave Black : @daveblack101
Dave Black
@daveblack101
Gotcha. Cheers guys
Sébastien Ros
@sebastienros
I am in the room already
somecodeguy
@dafergu2:matrix.org
[m]
What could cause a page being rendered to not respect templates? I've got a custom route that returns a view in which I render a shape. I've tried changing the alternate but the rendered page doesn't have an alternate listed in its model. I've also tried overriding the template with the admin tool and with a cshtml in my theme to no avail. I feel like it is something simple that I'm not understanding.
vmahant
@vmahant
Any Idea I can't see image on frontend. Shortcode feature is enabled though
image.png
image.png