These are chat archives for OrchardCMS/Orchard

9th
Mar 2017
Xceno
@Xceno
Mar 09 2017 10:42

Folks I have a caching issue (i guess). I have a getter like this, which will be called while building a viewModel in a WebApi-Action.

public IFileDescription Logo {
    get {
        var files = this.AsField<MediaLibraryPickerField>(typeof(CompanyPart).Name, FieldNames.Logo)
        .MediaParts
        .Select(x => new FileDescription(x, false));

        return files.FirstOrDefault();
    }
}

It crashes inside the MediaPart getter

public IEnumerable<MediaPart> MediaParts { 
    get {
        return _contentItems != null ? _contentItems.Value : Enumerable.Empty<MediaPart>();
    }
}

with following exception: {"collection was processed twice by flush()"}

I've also seen other nhibernate exceptions bubble up there.
Any hints or guesses what could possibly go wrong here?

It also doesn't happen consistently at first, sometimes the exception only happens after requesting this resource several times.

KumarVikey
@KumarVikey
Mar 09 2017 12:48
i want to call my action method of home controller.how can i manage the route in orchard for this.can any body suggest me.
i wrote the code for this in route.cs as following...
new RouteDescriptor {
Priority = 52,
Route = new Route(
"Home/ApplicationPoolRecycle",
new RouteValueDictionary {
{"area", "Machinery"},
{"controller", "Home"},
{"action", "ApplicationPoolRecycle"}
},
new RouteValueDictionary(),
new RouteValueDictionary {
{"area", "Machinery"}
},
new MvcRouteHandler())
},
still is there something that i have to manage.....in orchard.
to perform routing.
jiangyo4
@jiangyo4
Mar 09 2017 13:25
How to get Count value of content items by input field in orchard?
I have a custom Content Type "News" with custom field "Author" (Input Field);"title";"body";"autoroute",I would like to display statistics like this: 1."Peter" : 20post; 2."Linda" : 15post; 3."Mary" : 10post; ....
I can't use taxonomy terms, I don't know Author's name.How to get Count value of content items and sort by "Author" (Input Field) ? Or I don't use "Author" (Input Field), To use "Author" (tag) ,can I? Thanks!
Andrew Connell
@andrewconnell
Mar 09 2017 14:44

anyone know the SQL query for all blog posts (metadata & content) of the current published version? looking to get the title, URL, tags, associated dates & content (not comments) of every page. Need to do the same thing for pages as well but ok if that's a different query. Currently on Orchard 1.9.*

why: over 10yrs have used different content in my blog and want to do a cleanup. one example are code references... using this query I can quickly ID the posts.

Sébastien Ros
@sebastienros
Mar 09 2017 16:09
@andrewconnell why not use an Export, do the cleanup in the XML, then import the same file?
Andrew Connell
@andrewconnell
Mar 09 2017 16:16
@sebastienros because the export is timing out ... after bumping up the timeout twice, it's tedious when my deployment is hosted in an Azure Website where access to the files is not terribly simple. Open to suggestions though
Sébastien Ros
@sebastienros
Mar 09 2017 16:17
I assume you don't have the Batch property, it must have been added in a later version. ok, I'll give you the query.
Andrew Connell
@andrewconnell
Mar 09 2017 16:17
Not familiar with Batch property. I'm on 1.9.1... apparently the export command on orchard.exe isn't in 1.9.1
Sébastien Ros
@sebastienros
Mar 09 2017 16:18
and btw, time for us to migrate your blog to Orchard Core ;)
Andrew Connell
@andrewconnell
Mar 09 2017 16:18
Thanks for that link... wasn't coming up in my google-fu :)
Sébastien Ros
@sebastienros
Mar 09 2017 16:19
we just need to finish the media management and you would be a good candidate for a migration I think
Andrew Connell
@andrewconnell
Mar 09 2017 16:19
Took a look at the content on Orchard Core... saw stuff that made me think migration was going to be a huge task so tabled it as I've already got my hands full :)
With well over 1000 post from the past 14 years, I'm open to kicking the tires.
Sébastien Ros
@sebastienros
Mar 09 2017 16:20
shouldn't be hard to migrate IMO. Your content model is simple.
Xceno
@Xceno
Mar 09 2017 16:25
@sebastienros slightly off topic: any hosting recommendations for a private blog based on o2 from the top of your head?
Sébastien Ros
@sebastienros
Mar 09 2017 16:25
o2, honestly the only one I know of is Azure Web Sites
unless you want to try a linux hoster
I'd like to see how it behaves on a hoster like DigitalOcean, do you want to test?
using a SQlite databse, or any other that DO is providing
Xceno
@Xceno
Mar 09 2017 16:29
well yeah. I have some old websites to migrate and wanted to start a blog for some time now but i'm struggling to find a hoster i'm comfortable with.
I'm almost ready to give up and follow troy hunts recommendation for using https://ghost.org/de/pricing/
Sébastien Ros
@sebastienros
Mar 09 2017 16:31
if what you only need is a simple blog, yes that's the best solution right now. I can't recommend O2 until we have any media UI.
Andrew Connell
@andrewconnell
Mar 09 2017 16:31
My next deployment will be in a linux container w/ kubernetes
Xceno
@Xceno
Mar 09 2017 16:32
Ah okay, then I'll have to wait a bit. I need some nice media management for my other sites
Sébastien Ros
@sebastienros
Mar 09 2017 16:32
you should try orchard core;)
I am "currently" working on it, should have a demo ready for Tuesday, and probably something ready to use by the week after.
If you have suggestions and requirements, time to let me know
Xceno
@Xceno
Mar 09 2017 16:34
I know i should!
I'm probably the last one you need to convince :D
Just a time issue right now
I try to give it a shot this weekend and see how far I come
Andrew Connell
@andrewconnell
Mar 09 2017 16:35
Time is always my issue. Saw that post @sebastienros ... Looking forward to standing up a K8 cluster via ACS to host blog + other containerized apps i play with