OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Orchard 1.5 RC2 null exception #2641

Closed orchardbot closed 9 years ago

orchardbot commented 12 years ago

infofromca created: https://orchard.codeplex.com/workitem/18814

1- install as admin ( enable Orchard.CustomForms on recipe in the beginning ) 2- go to dashboard 3-click users 4-click roles 5-click edit link of author or anonymous or..(except for administrator)

{"Object reference not set to an instance of an object."} source : Orchard.CustomForms stack: at Orchard.CustomForms.Security.AuthorizationEventHandler.Adjust(CheckAccessContext context)

orchardbot commented 12 years ago

@sebastienros commented:

Can't repro. What modules have you enabled ?

orchardbot commented 12 years ago

infofromca commented:

Orchard.AntiSpam,Orchard.CustomForms,

orchardbot commented 12 years ago

@sebastienros commented:

I have them enabled too, and I use them both right now, it's working for me. Could you debug the code to see where it's coming from ?

orchardbot commented 12 years ago

infofromca commented:

namespace Orchard.CustomForms.Security public class AuthorizationEventHandler

line 18

if (!context.Granted && context.Permission.Name == Orchard.Core.Contents.Permissions.EditContent.Name && context.Content.ContentItem.ContentType == "CustomForm") {

orchardbot commented 12 years ago

@sebastienros commented:

Fixed in changeset 9d8b680a3e9b

orchardbot commented 12 years ago

infofromca commented:

the new version is very strange for me, because of

if (!context.Granted && context.Permission.Name == Orchard.Core.Contents.Permissions.EditContent.Name && context.Content == null

&& context.Content.ContentItem.ContentType == "CustomForm") {

if context.Content == null, then context.Content.ContentItem.ContentType will not be excuted. how can they put together?

orchardbot commented 12 years ago

@sebastienros commented:

Fixed in changeset 94a9eafa8479

orchardbot commented 11 years ago

@sfmskywalker commented:

Fixed in changeset 45fbfd96dd32833cc0029d68aeceaef1fa69dec1

orchardbot commented 11 years ago

@sfmskywalker commented:

Fixed in changeset 5683e2557bb72708b4d5c77ca46b4557b75f1340