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)

Nic Scott
@Nic-84
On any of Orchard's login, registration, password reset, (any system form that Orchard presents to the user) I am running in to a problem of being able to click the submit button multiple times. When I go to simply log in, I can click the submit button repeatedly (because sometimes it takes a few seconds to log in) and it fires off a new instance of my workflow for every time I click the submit button. I am trying to register new users through the login form, and I believe it has broken some of my workflows because someone has clicked the "Register" button multiple times when trying to register. I get errors when trying to view my workflow instances of my registration workflow, and it's no longer letting these users verify their email addresses because they appear to be broken. Could some code be put in place to only allow the user to click any submit/register button once?
Nic Scott
@Nic-84
An update to my previous post: I can't get access to any of my workflows now on my server. Everything still seems to work fine locally, but when I test them out on my server I just get a "This page isn't working, HTTP Error 500". Any ideas why workflows are working locally, but not on the server? Is there a folder that needs permissions updated for some reason? Sorry, I hardly know any .net, so this stuff is making me bonkers! Everything local works beautifully and is awesome...
Dean Marcussen
@deanmarcussen
@Nic-84 find the log file on the server and have a look at it, in prod we don't return anything more than a 500, so you have to look in the logs. They're in App_Data/Logs Depending on how you deployed them you may have to renegerate some data protection keys / urls on the http request activity. if that's what you're using
1 reply
Josiah Nunemaker
@JosNun

Is there a way to call Orchard.DisplayAsync from a page in the Pages/ folder? I have a page that looks something like this:

@page "/{item}/form"
@inject OrchardCore.IOrchardHelper Orchard

@{
    var itemPath = ViewContext.RouteData.Values["item"];

    var contentItem = await Orchard.GetContentItemByHandleAsync("slug:" + itemPath, true);
}

<div>
    Have some content:
    @await Orchard.DisplayAsync(contentItem);
</div>

And it can't seem to find DisplayAsync on Orchard? 'IOrchardHelper' does not contain a definition for 'DisplayAsync' and the best extension method overload 'OrchardRazorHelperExtensions.DisplayAsync(IOrchardDisplayHelper, ContentItem, string, string, IUpdateModel)' requires a receiver of type 'IOrchardDisplayHelper'. Is there a way to inject an instance of IOrchardDisplayHelper instead of IOrchardHelper?

3 replies
Jasmin Savard
@Skrypt
Do you have a _viewImport.cshtml file?
image.png
pbull001
@pbull001
Is the LastResult of an activity accessible via a Liquid expression e.g. Workflow.LastResult?
Nic Scott
@Nic-84
@deanmarcussen, or if anyone else has any ideas - This is in reference to my post a few posts up... I added logging to my site and I see the log file now. I will mention that I have created a custom email task to use in workflows, and it looks like that's where the error is coming from. Here is the error that I get: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.Exception: Shape type 'CustomEmailTask_Fields_Design' not found. And then there is probably like 500 or more lines of stack trace data. Again, the workflows work great locally. I am only running in to this problem on my dev/prod server.
Dean Marcussen
@deanmarcussen
CustomEmailTask_Fields_Design
did you forget to publish this file? it doesn't look like one of orchard's view files
Nic Scott
@Nic-84
Is there a reason why it wouldn't get published? All of my files for the CustomEmailTask for the workflows are included and part of my project. I will keep researching to see if I can find anything, but as far as I can tell, everything is getting published.
I will also note, I am getting both of these errors/exception, not just the one:
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.Exception: Shape type 'CustomEmailTask_Fields_Design' not found
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An exception was thrown attempting to execute the error handler. System.InvalidOperationException: Multiple handlers matched. The following handlers matched route data and had all constraints satisfied: Void OnGet(), Void OnGet()
I'll keep searching, but if you have any ideas in the meantime...
Niraj Soni
@ns8482e
What kind of project it is? Theme or module?
Kevin Welsh
@kdubious
@deanmarcussen could use some guidance on how to close out the PR for the doc I created from your dev team notes
Nic Scott
@Nic-84
I am using Orchard as a content management tool only. It's a decoupled razor page website. I have some workflows that publish/unpublish content items, as well as send email communications. I created a custom email workflow task to work specifically with my mail server instead of using the stock Orchard email settings (which I may switch back to). Everything works locally. My workflows actually work on the prod server, but when I log in to the Orchard admin and try to edit a workflow on my prod server, I get these errors.
Dean Marcussen
@deanmarcussen
did you remember to turn the module on @Nic-84
@kdubious sure, I'm here tomorrow for a bit. be good to tweak that one up and get it in
Kevin Welsh
@kdubious

2021-10-22 15:46:07.9675|Default|00-e58340824438a948a758976c2522db95-31eb2ee35aa67849-00||Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PKDocument3214EC071B675274'. Cannot insert duplicate key in object 'dbo.Document'. The duplicate key value is (21).

Any ideas?

2 replies
@deanmarcussen I'll try to get on here tomorrow, not sure if I can
Nic Scott
@Nic-84
Yes, I have the email module turned on if that's what you are referring to. Some of the features of my site wouldn't work locally if something wasn't turned on, right? I feel like I probably need to abandon my custom email task for my workflows at this point. I was using them because I couldn't get the stock Orchard email module to work with my mail server. The email module works, but only when the encryption is set to none, so that's not going to cut it. Trying to use SSL just gives me errors. I was able to swap out the SMPT settings in my custom email workflow task and that worked. But I am going to have to figure out how to get the stock Orchard email module to work. I need to allow new users to verify their registration and manage their own password through email, and that only works with the stock Orchard email module.
3 replies
Niraj Soni
@ns8482e
Is your custom worflow task is in module or web application?
if its in web application check if your shape file is copied when you publish your web app
Richard Garside
@NogginBox
I've got Azure Devops setup to deploy an Orchard site with my own theme project.
The theme static files like CSS and images are not being displayed. I think they've not been deployed. Am I missing a step or a project setting?
Dean Marcussen
@deanmarcussen
have you checked they are in git @NogginBox . often the wwwroot folders are ignored by the default .gitignore
Richard Garside
@NogginBox
@deanmarcussen they're in there. Do all the files need a build action setting on them?
Richard Garside
@NogginBox
Hmmm. Some files are being shown like my icon file. I'm confused.
Richard Garside
@NogginBox
Looks like theme resources are case specific. Making sure case matches.
Richard Garside
@NogginBox

Almost there now with http://new.nogginbox.co.uk/

But my menu tag is getting rendered in the HTML as:

<menu alias="alias:main-menu" cache-id="main-menu" cache-fixed-duration="00:05:00" cache-tag="alias:main-menu" />

It's working fine on my local machine.
Dean Marcussen
@deanmarcussen
nice! you need to add a direct reference to the OrchardCore.Menu nuget package from your theme.
Richard Garside
@NogginBox
Thanks @deanmarcussen that sorted it.
Nogginbox is now updated from Orchard Classic to Orchard Core.
https://www.nogginbox.co.uk/
Just need to write some actual more blogs posts now.
Chris Norman
@inzi
Disclaimer, new to OC. I am trying to make my module the 'default route' . I have home route disabled in features, and I'm attempting attribute routing for the controller, but I get a 404. At the controller level, I'm specifying Route for "", "~/" - I just looks like these are being ignore. Is there something I have to do in the host project in startup to get it to honor attribute routing?
Niraj Soni
@ns8482e
You need to enable your module
[Route("")] or [Route("~/")] works
Dody Gunawinata
@dodyg
I am using OrchardCore.Module in my MVC Application. It's not a CMS. I need to implement a background service. I read that IBackgroundTask needs to be enabled from the Admin module. The problem is I don't have this. Is there anyway for me to enable a background task from code?
Sotiris Roussos
@urbanit
Hey guys, need urgent help here...
  1. Deployed to Orchard site to Azure through GitHub Actions
  2. With empty App_Data, I got setup screen
  3. SetUp and access site
  4. Replace in app.setting Connection string & upload ContentDefinition.json : error 500
  5. Error: Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer: Connection ID "14195346027082417527", Request ID "80000578-0000-c500-b63f-84710c7967bb": An unhandled exception was thrown by the application.System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Http.Polly, Version=5.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
  6. Additional Error: ```<div id="content">
    <div class="content-container">
     <h3>HTTP Error 500.0 - Internal Server Error</h3>
     <h4>The page cannot be displayed because an internal server error has occurred.</h4>
    </div>
    <div class="content-container">
     <fieldset>
         <h4>Most likely causes:</h4>
         <ul>
             <li>IIS received the request; however, an internal error occurred during the processing of the request.
                 The root cause of this error depends on which module handles the request and what was happening in
                 the worker process when this error occurred.</li>
             <li>IIS was not able to access the web.config file for the Web site or application. This can occur if
                 the NTFS permissions are set incorrectly.</li>
             <li>IIS was not able to process configuration for the Web site or application.</li>
             <li>The authenticated user does not have permission to use this DLL.</li>
             <li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li>
         </ul>
     </fieldset>
    </div>
    <div class="content-container">
     <fieldset>
         <h4>Things you can try:</h4>
         <ul>
             <li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web
                 server's machine account.</li>
             <li>Check the event logs to see if any additional information was logged.</li>
             <li>Verify the permissions for the DLL.</li>
             <li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li>
             <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about
                 creating a tracing rule for failed requests, click <a
                     href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li>
         </ul>
     </fieldset>
    </div>```
Sotiris Roussos
@urbanit
Q: how can we disable a feature from console in production? UI is not available... Is it file or database?
Dean Marcussen
@deanmarcussen
database @urbanit there's two documents you have to tweak. they're generally towards the top of the Document table
Sotiris Roussos
@urbanit
Yeap, thanks, found it... But I have a very strange issue: when I enable Recaptcha feature on production, site returns always 500 ???
Without logs.. same in local env towards production database, succeeds
Dean Marcussen
@deanmarcussen
bad settings possibly? might be hiding the exception, or logging it with the wrong information level
15 replies
Venkatesan R
@vengi83644
2 replies
Stefan Tropčić
@stefan73_gitlab
Is it possible to add additional options to sort and show admin filters in content item list in admin theme (ContentsAdminListFilters shape). Would be thankful for any guidance. I thought removing default implementation with empty template through placement would suffice but then realized default values will always be there. Is there something I am not seeing?
Niraj Soni
@ns8482e
How to query User for CustomUserSettings? Is there any Index table available?
1 reply
Dean Marcussen
@deanmarcussen
If you want to query a value there you have to make your own index . Check whether you need a query or if you would want to put a value in the users claim instead
For the admin filters there are many (maybe too many) hooks for them. You can replace the view. But if you just want an extra sort order an adminfilter should be able to add to the collection.
1 reply
Dean Marcussen
@deanmarcussen
You’ll need to be specific about exactly what you want to achieve. There’s so many different hooks there it’s hard to know exactly what to suggest. Probably it’s a matter of binding another filter provider which uses a different value and applies a different sort if that’s what you want. I think a new filter registered later could override that terms behavior
Stefan Tropčić
@stefan73_gitlab
image.png
disregard old design...would like to remove unpublished property based on contentType list so if there is content type which isn't draftable i would like to show unpublished, and add some default user apropros "owned by me"..."owned by x"...orders are probably more problematic, because if I would like to order by some property in some index, i never want default ordering by modifiedUtc
2 replies
Niraj Soni
@ns8482e
i was thinking like _session.Query<User>().Where( /*condition*/ ) but i don't see where method