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)

Dean Marcussen
@deanmarcussen
you can go to general settings, and click save, which will reset the shell, which conveniently resets the local cache. Which is reasonably universal for anything that is cached
(I nearly made that a button in there which is called reset cache. but then it wouldn't always work so well when using redis, so decided was better not to)
somecodeguy
@dafergu2:matrix.org
[m]
nod If it gets too painful, I may look at adding the invalidate cache after X amount of time option and submit a PR. Thanks for the explanation! Makes sense.
Dean Marcussen
@deanmarcussen
your other (better option in my opinion), is push those ctds out through remote deployment to the server. that's kinda how the system is designed, and at that point, it'll know about the changes, so handle any caching
somecodeguy
@dafergu2:matrix.org
[m]
we will for the main deployments, but this is the CI dev server. The dev team is pointing to a shared dev db which the CI dev server also is using. This means that we're all working off the same env. Typically that's been fine as we do regular commits to our code which forces a restart on the ci dev server. Just didn't happen in the last day.
somecodeguy
@dafergu2:matrix.org
[m]
@deanmarcussen: Is that you in the https://www.youtube.com/watch?v=DRKfeBehmGY
Dean Marcussen
@deanmarcussen
yeah the accent gives it away a bit ;)
somecodeguy
@dafergu2:matrix.org
[m]
I noticed the user name in the console. :)
I've been looking for that exact module for oc, so awesome. :)
Dean Marcussen
@deanmarcussen
great. hope it's useful!
somecodeguy
@dafergu2:matrix.org
[m]
I'm sure it will be.
somecodeguy
@dafergu2:matrix.org
[m]
Are we able to query a list of content items (testimonials) within a liquid template? For example, I have a some content items that I just want to grab a random set of 4 items. Obviously they aren't in a part on the content item (page), I just want to to get a list of any random testimonial content items and render them.
somecodeguy
@dafergu2:matrix.org
[m]
Ah, I see, I need to create either a sql index query or a lucene query.
Jean-Thierry Kéchichian
@jtkech
@deanmarcussen @dafergu2:matrix.org even if not using a distributed cache, you can already config cache options for each shared document type full name, see our DocumentOptions that inherits from DistributedCacheEntryOptions, so from memory you can use the following in any config source e.g. appsettings.json under the OrchardCore section
"OrchardCore.ContentManagement.Metadata.Records.ContentDefinitionRecord": {
  "AbsoluteExpiration": "00:05:00",
  ...
},
1 reply
somecodeguy
@dafergu2:matrix.org
[m]
Hrm, is there no way to do an 'order by' on a sql query?
Ah, it doesn't like the use of ORDER BY newid() instead of a column.
Sébastien Ros
@sebastienros
order by ID should work
somecodeguy
@dafergu2:matrix.org
[m]
Is there a way around that?
trying to get sql server to randomize the result set.
if I take out the order by, it's all good and great.
Is there a way to tell the query engine to just use the sql text as is and not try and parse it?
somecodeguy
@dafergu2:matrix.org
[m]
I suppose the right way would be to create a rand filter similar to the limit filter?
bsamba
@bsamba

Hi all, can someone explain the following logic in OrchardCoreBuilderExtensions.cs
// Before the setup a 'DatabaseProvider' may be configured without a required 'ConnectionString'. if (shellSettings.State == TenantState.Uninitialized || shellSettings["DatabaseProvider"] == null) { return null; }

I'm trying to spin a new project using OC nuget packages, but it's failing with a null pointer for the Session (IStore).

23 replies
somecodeguy
@dafergu2:matrix.org
[m]
What are you trying to do? You likely have to set your shell provider to be a database in your appsettings file.
by default it is a local sqlite file, but if you want it to be a database, you have to configure it.
Sébastien Ros
@sebastienros
@dafergu2:matrix.org oh you want to randomize? I think we implemented it already
let me check
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: Yup, just wanna get a list of three random testimonials.
I need to figure out how to make this list separate in the admin menu too, but that's a different task. :)
bsamba
@bsamba
@dafergu2:matrix.org I already set up the configs properly, I can read the properties. But the state is Uninitialized as it supposed to be
Sébastien Ros
@sebastienros
yessql supports it with "OrderByRandom()"
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: I'm using sql server.
Sébastien Ros
@sebastienros
now I think this should be handled in the Queries module to check if orderby is random() for instance, and call this yessql function
the Queries modules uses a "common SQL syntax" that is converted to specific dialects
file an issue and I will look into it. In the meantime it won't be random
somecodeguy
@dafergu2:matrix.org
[m]
I'm trying to find the code where the limit filter (liquid) is done. That way I can just write my own liquid filter to append the order by newid() to the query.
or does the query filter do the parsing after the limit filter is applied?
@sebastienros: I'll happily file an issue, would like to see if I can track down where I should make that change and implement it with a PR to OC.
Sébastien Ros
@sebastienros
should not be that hard. In Queries module there is a SQLParser, that creates an AST of a SQL query. Then it uses a SQLBuilder and SQLDialect from yessql to build the query for the target db. There it should detect a call like random() and invoke OrderByRandom() on the SqlDialect instead of adding it as an OrderBy field.
1 reply
mmdqq
@mmdqq
image.png
When I created a new rolse, I found that the common rules control did not work
mmdqq
@mmdqq
I don’t want to modify the source code. Can I create a new module and modify the default role rules through middleware?How to get the role rules and modify it in the middleware?
juergen-de
@juergen-de
I upgraded a project to that latest cloudsmith packages and since then it does not start anymore without any error messages. After some seconds it simply ends and returns to Visual Studio. To find out what happens, I cloned the dev repo, added my Theme and my App_Data folder, but the solution does not build with errors in OrchardCore.Media.Core.
Error CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute OrchardCore.Media.Core (net5.0) \Repos\OrchardCore\src\OrchardCore\OrchardCore.Media.Core\obj\Debug\net5.0.NETCoreApp,Version=v5.0.AssemblyAttributes.cs 4 Active
Any idea how to proceed ?
Dean Marcussen
@deanmarcussen
you'll probably need to do a dotnet clean, or delete your bin/obj folders. there was a duplicate at one point with that media.core project
1 reply
Kshitiz
@KshitizGIT
is the style rendering working in the dev branch ?? {% style name: "name" %} is not rendering the style sheet
issue-media-group
@issue-media-group
Hi all. I have the default tenant setup as an Open ID Connect server with Authorization Code Flow and Client Credentials Flow enabled. I also have an Open ID Connect Application configured with the same flows enabled, scopes allowed set to openid, profile, email, and roles, and all client credentials roles checked. I have an additional tenant setup (currently for testing) as an Open ID Connect client using the Code Authentication Flow. I'm able to authenticate the client tenant using this setup. However, it appears that the roles are not being passed through to the client as externalClaims (when using the script to set user roles base on external provider claims under the login settings). If you can help identify what I may be doing wrong it would be much appreciated. Thanks in advance.
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: Hey Sebastion, I created an if filter for my liquid theme. Would you guys be interested in it? I found myself constantly wanting to attach a class under certain conditions, so I wrote a filter for it.
I use it kind of like a ternary operator. <div class="row {{ mycondition | if: true: " mytrueclass", false: " myfalseclass" }}">
Sébastien Ros
@sebastienros
<div class="row {% if mycondition %}mytrueclass{% else %}myfalseclass{% endif %}">
8 replies