Skip to content

Problem when reading SiteSettings from the Routes class #7362

@ThaerAlAjlouni

Description

@ThaerAlAjlouni

I am trying to read SiteSettings in the Routes class, because I need to optionally add a route depending on some setting values, but it will throw an error each time I try to do that because the WorkContext instance will be null. I knew that a similar issue ( #6991 ) has been resolved and I think the same fix can be applied here.

As you can see below (DefaultOrchardShell class) the OwinMiddlewares and Orchard's Shell events are wrapped with a WorkContextScope while Routes are not:
defaultorchardshell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions