These are chat archives for OrchardCMS/Orchard

14th
Nov 2016
Subrata Sarkar
@emfluenceindia
Nov 14 2016 04:41
Hello
Hello World
How I can configure my Orchard site to run from VS 2012 / 2015 IDE? So far I am using WebMatrix but it does not give me debug facility.
robhal24
@robhal24
Nov 14 2016 08:58
Hi everyone, my AutoroutePart editor template is not appearing the backend for any content item (e.g. blog post or blog). I'm not overriding any placement.info settings... I'm a bit lost as to what this could be... any leads?
1.10.1 version btw..
@emfluenceindia you don't have to configure anything? You can just open and run the application from Visual Studio?
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:14
@robhal24 Thanks. But when I am trying to run I am getting a compilation error from Lucene
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:15
@emfluenceindia what is the error? Could it be that some NuGet dependencies are not loaded correctly?
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:15
@MatteoPiovanelli-Laser let me have a quick look please
The error says Object Reference not set along with a few warnings
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:19
and this for a clean pull from the 1.10.1 branch?
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:19
I pulled from github fork
but when I am running from WebMartrix the error is not showing up and the application runs ok
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:22
I have never used WebMatrix, so I cannot help you there. It's just weird that you are getting build errors. Could you double-check that the fork is actually aligned with a stable "version"? I think 1.10.1 was fine, and 1.10.x definitely is (but the latter get updated quite often, so you may not want that)
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:23
I don't want to WM either! do you recommend to clone a fresh version?
I meant fresh clone
?
btw, the cloned version downloads the source, am I right?
robhal24
@robhal24
Nov 14 2016 09:26
cloning clones the source using GIT, downloading the source downloads the files
both contain the sourcecode yes
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:28
actually I am little confused about installing Orchard vs. cloning from github and using it to build an application. Orchard Getting started recommends installing via Web PI, which opens via WM by default and opens the site setup interface upfront. But honestly I am not sure which one to use. If I have to use the cloned source I would use Orchard.Web to configure my site locally, is this right?
robhal24
@robhal24
Nov 14 2016 09:30
yes Orchard.Web is the web application project
Subrata Sarkar
@emfluenceindia
Nov 14 2016 09:32
Thank you. Let me try opening this with VS 2012 and see if I still encounter the compilation issue
robhal24
@robhal24
Nov 14 2016 09:34
VS 2012 is rather old, make sure you have the latest .NET framework etc.
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:34
I have no issues with VS2015
robhal24
@robhal24
Nov 14 2016 09:35
also on 2015 here, no problemos
except for my AutoroutePart question which is getting out of focus because of this discussion :D
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:38
@robhal24 did you change something in the template? Or did you only set up a tenant and are not seeing it?
robhal24
@robhal24
Nov 14 2016 09:40
i've downloaded source and implemented a custom template, but the AutoroutePart editor view is in the admin template
(or actually Autoroute module)
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 09:59
sorry, I am not sure I understand. Did you add a view in the Autoroute Module?
robhal24
@robhal24
Nov 14 2016 09:59
no i didn't do any of that
I just downloaded the source, created a new template using code generation, implemented it (blog alternates). Then I went to /admin and created a new blog and a new post. Both the blog item and the blog post item don't show an editor for Autoroute...
blob
Subrata Sarkar
@emfluenceindia
Nov 14 2016 10:15
@robhal24 Sorry to interrupt. Thanks for your suggestion. 2012 build failed, so I opened in 2015. Build went successful and site setup page appears.
robhal24
@robhal24
Nov 14 2016 10:35
@emfluenceindia good to read :)
Subrata Sarkar
@emfluenceindia
Nov 14 2016 10:36

ThanHowever I encountered another problem when setting up the site:

An exception of type 'NHibernate.TransactionException' occurred in NHibernate.dll but was not handled in user code Additional information: Transaction not connected, or was disconnected

I am googling but yet to find a solution

Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 10:36
@emfluenceindia good to know.
@robhal24 I have never used orchard templates. Only ever did views in code. Might be worth verifying, in your COntent Definitions, that both Blog and BlogPost have Autoroutepart attached
@emfluenceindia verify that your db manager is accessible. In Windows, you should have the corresponding service running.
Subrata Sarkar
@emfluenceindia
Nov 14 2016 11:24
@robhal24 I never used Orchard before so trying to set things up for the first time following their instructions. I am using SQL Server. Tables were created OK in the database. I am a newbie to Orchard. Please advise an alternative way I can learn this CMS. My ultimate goal is to first create a custom Orchard theme for my website and based on it build the functionality. Your suggestions would be greatly helpful.
robhal24
@robhal24
Nov 14 2016 12:59
@MatteoPiovanelli-Laser it's just a default installation :)
@emfluenceindia you are starting correctly with the source and you already have your instance running. Now follow this: http://docs.orchardproject.net/en/latest/Documentation/Writing-a-new-theme/
Subrata Sarkar
@emfluenceindia
Nov 14 2016 13:02
@robhal24 Thank you for providing the link. I will read it! But first I need to get rid of this "An exception of type 'NHibernate.TransactionException' occurred in NHibernate.dll but was not handled in user code. Additional information: Transaction not connected, or was disconnected", which is not going away! :(
robhal24
@robhal24
Nov 14 2016 13:03
try checking the logs
Subrata Sarkar
@emfluenceindia
Nov 14 2016 13:22
@robhal24 The commit/rollback have issues. So rather that trying to commit the transaction (_session.Transaction.Commit();) I disposed it off directly if the Transaction.IsActive is true, i.e. _session.Transaction.Dispose(); The site is now up and running. I tried this because the database objects are all created perfectly and the process is about to launch, so I go ahead with a Transaction disposal directly. Is this the right way to go?
robhal24
@robhal24
Nov 14 2016 13:26
sometimes my instance also locks up with that nhibernate exception during development, i always rebuild source and recycle app pool and most of the times it's fine again. I do always keep in mind what i was doing and if I was changing the database schema using migrations. If so I doublecheck if everythign is alright
Subrata Sarkar
@emfluenceindia
Nov 14 2016 13:28
Thank you. I will keep this in mind :)
Hazzamanic
@Hazzamanic
Nov 14 2016 15:54
Does Orchard have something to let us know when an item is being previewed? Or would we just have to check the url for version parameter or something?
Antoine Griffard
@agriffard
Nov 14 2016 16:11
Content extension HasDraft :
public static bool HasDraft(this IContent content) {
            return (
                       (content.ContentItem.VersionRecord != null)
                       && ((content.ContentItem.VersionRecord.Published == false)
                           || (content.ContentItem.VersionRecord.Published && content.ContentItem.VersionRecord.Latest == false)));
        }
Hazzamanic
@Hazzamanic
Nov 14 2016 16:14
sorry, I meant like during a request
so previewing a content item with a content picker, I'd like it to pick up and display unpublished items when in preview, same with containers, because ultimately when they publish it all that is what they will see
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 16:16
@Hazzamanic you mean like a Display view, that is actually a Preview?
No, wait, that sounded wrong.
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 16:22
What I meant to say, in more detail is:
I don't think there is a "Preview" DisplayType. When a view is called for a preview, the displayType is "Detail".
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 14 2016 16:31
so, beside looking at the version parameter, as you said above, I don't see a quick way
I am positive you could, if you are willing to write view alternates, verify in the .cshtml if the ContentItem you are displaying is published, and then behave accordingly.