Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 29 2019 22:35
    HeyJoel closed #294
  • Jan 29 2019 22:35
    HeyJoel commented #294
  • Jan 24 2019 12:13
    HeyJoel closed #297
  • Jan 24 2019 12:13
    HeyJoel commented #297
  • Jan 24 2019 12:11
    HeyJoel commented #296
  • Jan 24 2019 10:58
    HeyJoel milestoned #296
  • Jan 24 2019 10:58
    HeyJoel labeled #296
  • Jan 23 2019 11:24
    ernestoSerra commented #296
  • Jan 22 2019 21:44
    HeyJoel commented #150
  • Jan 22 2019 16:46
    j7rowan commented #150
  • Jan 21 2019 12:28
    HeyJoel commented #297
  • Jan 21 2019 12:28
    HeyJoel commented #297
  • Jan 21 2019 12:08
    Enlatic commented #297
  • Jan 21 2019 12:03
    HeyJoel commented #294
  • Jan 21 2019 11:55
    HeyJoel commented #297
  • Jan 21 2019 11:55
    Enlatic commented #297
  • Jan 21 2019 11:49
    HeyJoel commented #297
  • Jan 21 2019 11:47
    Enlatic edited #297
  • Jan 21 2019 11:46
    Enlatic edited #297
  • Jan 21 2019 11:45
    HeyJoel commented #296
Stefan Moonen
@Qonstrukt
Should I try changing the Max Pool Size in the connection string maybe? What is the DbContext set to for Cofoundry?
Joel Mitchell
@HeyJoel
It will use the default which should be more than enough. I don't think anything much changed in the 3.1 migration from our perspective, but there's always big under-the-cover changes in EF and ASP.NET that might impact something. It will probably be a while for me to look into this one.
Stefan Moonen
@Qonstrukt
Yeah I figured, if you are running 3.1 instances yourself without these issues it might also be related to my own code still of course.
Joel Mitchell
@HeyJoel
Well, the ErrorLogging plugin is much neglected and if it's only picked up in logging I probably won't have seen it if it has occured. I'll need to have a dig around. Is it a recurring issues for you? If it was a one-off Azure-wobble you might see connection timeouts that could lead to pool exhaution.
Stefan Moonen
@Qonstrukt
Yes it's a consistent issue. I have one pod stuck in this state now. I'm waiting to see if it will recover by itself. The console output keeps spamming these errors for now.
Stefan Moonen
@Qonstrukt
I updated the gist with a full request log: https://gist.github.com/Qonstrukt/419d67f5b0bc8582b26dcf3e0501ff6c
You can see the Cofoundry.Plugins.ErrorLogging.Data.ErrorLoggingDbContext throwing the error, but that might be very well caused by something else first throwing the error. The fact that it uses a different DB context is interesting though.
Joel Mitchell
@HeyJoel
hmm, perhaps it's getting stuck with logging a lot of errors
Can you take out the error logging package?
Stefan Moonen
@Qonstrukt
Sure
Joel Mitchell
@HeyJoel
It's not great because it literally logs every error to the db and so it can easily get overloaded - it's on the (long) list of things to be sorted. It's better to set up production-grade logging using the .NET core error logger and other 3rd party tools.
Stefan Moonen
@Qonstrukt
Yeah, that's why I figured it's not a real problem to get rid of it. We have Loki and Grafana running, so I could just grab logs from the container output and process it from there.
Joel Mitchell
@HeyJoel
I suspect you might find that fixes that error (and exposes a new one), but if not, this article seems to have some good info on tracking down issues with connectons https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks
Stefan Moonen
@Qonstrukt
Hmm, yeah I'm not able to look into those sys tables though it seems with an Azure hosted Sql Server.
Joel Mitchell
@HeyJoel
Ah ok. I wasn't seeing any issues when I ran it on one of our production sites with a reasonable amount of traffic, but the site isn't using the CMS parts of Cofoundry much.
Scott Remiger
@scottremigeraccuweather
I want to create a link to a page that may not exists so for example. I have a Product called WidgetA The users want to promote this product so they would create a custom page that is specific to that product. How would I check that the custom product page exists if so render that page otherwise, render a default page? Ideally, both would be manageable within the Pages area of the admin so the user can add a Header and Footer section to the default, but the contents would be rendered based on the product for the default page, whereas the custom page is the custom all the way and no Page-level model would be needed. I think it is here https://www.cofoundry.org/docs/content-management/custom-entity-pages but not understanding this vs Page and Page Types.
Joel Mitchell
@HeyJoel
@scottremigeraccuweather hi there, are you asking about redering an html link if a page exists? Or are you asking about a default page (404) if the product exists i.e. if a user navigates to /products/widget-a then a custom 404 would show? Or is it something else?
Scott Remiger
@scottremigeraccuweather
What I have is a situation where Widget-A will have a customized page with custom content and Widget-B, we just do not want to setup a custom page for Widget B and instead use values from a database and a default page template. So Widget-A would have a Page and Widget-B to Widget -Z would use the Page that is marked default.
Joel Mitchell
@HeyJoel
So, if I understand correctly, Widget A can be a normal custom (non CMS) page? CMS routing kicks in last in the pipeline, so you should be able to register a normal MVC route for that if you don't need any CMS content. The other pages you can handle as normal with a custom entity page (as you referenced earlier).
Bailey Ammons
@bammons
Hello there, is there anyway to get the default mailing to call an api service? For example when I add a user on the admin side I would like to be able to make an api call with the generated template. Or is there some way to intercept that mailing process when new users are added?
Joel Mitchell
@HeyJoel
You can make your own mail service integration. Take a look at the SendGrid plugin to see how that’s done.
Bailey Ammons
@bammons
Thanks, that was the trick
Oliver Smit
@technical2cents
Hi there Guys. I picked up a small issue inthe pagetemplate handler. the class GetPageTemplateDetailsByIdQueryHandler line 58 .GroupBy(v => v.PageId) , this causes an issue when querying metadata for pagetemplates and the line can be removed to solve the problem as there should be no group by on a non aggregate field., thought I would just share.
Eithere then that, enjoying your work :)
Joel Mitchell
@HeyJoel

Thanks @technical2cents for letting us know. The group by is required for the correct stats, but EF doesn't work well with GroupBy anymore. The fixed query should be:

queryModel.NumPages = await _dbContext
    .PageVersions
    .AsNoTracking()
    .Where(v => v.PageTemplateId == query.PageTemplateId)
    .Select(v => v.Page)
    .Distinct()
    .CountAsync();

I've committed the fix, thank you!

Oliver Smit
@technical2cents
Excellent. Thanks Joel.
Adam Yang
@adamy
Hi guys, has anyone successfully ran the ASP.NET identity alongside the Cofoundry v0.7 in .NET core 3.1? First the authentication urls don't load, I fixed it by add "routeBuilder.MapRazorPages();" in my RouteRegistration. Second, after I got the login screen, the user/password works, but I got redicted back to an unauthorised page after a successful login. Removed the Cofoundry pipeline and all back to work normally.
Joel Mitchell
@HeyJoel
Presumably there’s a reason you’re not using the Cofoundry user areas i.e. you’re running another application alongside Cofoundry? There’s no guidance here, but you’d probably need to override the Cofoundry auth startup task and modify it to your needs. I don’t have my laptop to hand so can’t look it up.
I was looking at making this area more configurable earlier in the year, so some feedback on your use-case would be helpful.
Adam Yang
@adamy
@HeyJoel Thanks. I am trying to add Cofoundry to an in-house ecommerce site that already has .Net core Identity for customers and admins. It is probably too hard to migrate my users to Cofoundry as there are too many changes. My client wants to be able to edit some contents on the site and create news items and updates. I like how Cofoundry works and it is relatively small footprint (compare with Orchard Core or Piranha). Ideally I would like all .Net core Identity users in "Admins" role can access the CMS admin portal and can do everything they want, but I can live with a seperate login system for CMS.
Joel Mitchell
@HeyJoel
@adamy that makes sense, it doesn't seem that uncommon to want to run a CMS alongside another application and it's something that's possible, but it's not straightforward. First off, I'm not very familiar with Identity, and it's been redesigned a few times since I last used it, so I can't help you too much on that part.
Secondly, I expect you'll need to override the way Cofoundry configures the auth at startup, this issue is a little old, but has the basic idea. Have a look at the source for DefaultAuthConfiguration.cs in the latest release to see what it currently does and what you'll need to override. the interface to override is IAuthConfiguration and the docs for DI tell you how to override stuff. If you need to inject anything into the startup pipeline the docs for that are here
Joel Mitchell
@HeyJoel
Thirdly, if you want to integrate your existing logins into Cofoundry, I think you'll need to have a custom login endpoint that manages the single sign on. In the above auth configuration you could set the LoginPath to your SSO script. Your SSO script would have to use the Cofoundry data APIs to create a Cofoundry user if it doesn't exist and log them in. The SPA Sample shows how you can use the data APIs, in particular the RegisterMemberAndLogInCommandHandler
As mentioned before, we'd like to make customizing the configuration of the 2nd part easier. People want to do lots of different things here so it's difficult, but we can definitely do better.
Adam Yang
@adamy
I will have a look. Thanks Joel.
Scott
@sremiger1

I have a class that will return a list of Page Directories for a select list in the DataModel

public class PageDirectoryOptionSource : IListOptionSource
{
 private CofoundryDbContext dbContext;
 public PageDirectoryOptionSource(CofoundryDbContext dbContext)
 {
   this.dbContext = dbContext;
 }
 public ICollection<ListOption> Create()
 {
   return (from p in dbContext.PageDirectories select new ListOption(p.Name, p.PageDirectoryId)).ToArray();
    }
 }

It will not inject the CofoundryDbContext. What alternative do I have build a list for the user based on information stored in the Cofoundry database? or What would be the best way to build a table of contents based on Page Directory?

Joel Mitchell
@HeyJoel
@sremiger1 have you looked at the menu sample project? https://github.com/cofoundry-cms/Cofoundry.Samples.Menus
greencmg
@greencmg

Having this issue with hosting on an Azure App Service - I developed a Custom Entity similar to the Blog Post examples. After I publish a new custom entity, and not logged into Cofoundry - I see this error in the log when browsing to the root of the site or any of the post NOT logged in. I can login into the admin but when the site begins to behave like this, I can no longer go into the Custom Entities settings. The same error below occurs. I have seen some behavior with deleting the cookies specifically the ARRAFINITY cookies. This does not occur every when running locally.

Main
MESSAGE:
Entity of type 'Cofoundry.Domain.CustomEntityRoute' and identifier '2' could not be found.

image.png
Joel Mitchell
@HeyJoel
Have you scaled out your app service? If you’re running multi-server you will run into caching issues unless you add a distributed cache service
I haven't built a distributed cache implementation yet, but it should be trivial to create your own with a provider like reddis see issue #46 cofoundry-cms/cofoundry#46
zedjr
@zedjr
is cofoundry the only code first unobtrusive cms system for asp.net
therrealdude
@therrealdude
@zedjr as far as I know it is the only free one. There is also Episerver, but it is getting more and more expensive every year. It is also code first. Not entirely sure what you mean by unobtrusive.
Clifford Anang
@NiiAnyetei
Hello, please I need help with an update exception "Cofoundry.Domain.PageTemplateRegistrationException: Duplicate template region 'Subtitle | What We Do' in template /Cofoundry/PageTemplates/_Home.cshtml". This happened when I removed a region on the Home page and created a new database. I checked the database and it updates PageTemplateRegion with previously defined regions.
Joel Mitchell
@HeyJoel
@NiiAnyetei our gitter is no longer for issues, they should be posted to the issue log where answers are more easily available to others. Please also do not post against unrelated closed issues - i've moved your question to #389
Clifford Anang
@NiiAnyetei
@HeyJoel Thanks you very much
greencmg
@greencmg
@HeyJoel I was able to develop a SQL Distributed Cache based of the InMemory Implementation in the BasicTest site example. DI System is picking it up in 0.7.0 and is working. When I move it to 0.8.0, the DI is loading my ObjectCacheFactory but is still using the InMemory. I tried setting the OverridePriority to High and still no luck.
Joel Mitchell
@HeyJoel
Hi @greencmg please submit an issue, we are no longer using Gitter for issues/support.
Please include your registration code so i can reproduce the issue
greencmg
@greencmg
Thanks @HeyJoel - submitted issue #399 ... I would really appreciate your guidance on this as getting this to work on Azure steadily would be awesome.