Im getting this error:
System.NullReferenceException: Object reference not set to an instance of an object. at SevenSpikes.Nop.Plugins.NopQuickTabs.AdminTabStripConsumer.AdminTabStripConsumer.HandleEvent(AdminTabStripCreated tabEventInfo) at Nop.Services.Events.EventPublisher.PublishToConsumer[T](IConsumer`1 x, T eventMessage)
When editing products.
Can you help?
How to change this code to nop core?
Hi there!
Could you please include PermissionProvider in all your plugins?
Should be nice allow access to each customer role.
Here is a sample, its is very simple (Replace XXX by plugin name):
namespace Nop.Plugin.XXX.Security
{
public partial class XXXPermissionProvider : IPermissionProvider
{
public static readonly PermissionRecord AccessXXX = new PermissionRecord { Name = "Plugins. XXX", SystemName = "AccessXXX", Category = "Plugin" };
public virtual IEnumerable<PermissionRecord> GetPermissions()
{
return new[]
{
AccessXXX,
};
}
public virtual IEnumerable<DefaultPermissionRecord> GetDefaultPermissions()
{
return Enumerable.Empty<DefaultPermissionRecord>();
}
}
}
_permissionService.InstallPermissions(new XXXPermissionProvider());
_permissionService.UninstallPermissions(new XXXPermissionProvider());
Dynamic prices should be dynamiclly updated inside add to cart modal window.
Found!!!!
It is a Nop bug, fixed in 3.5 version.
I found this code in ScheduleTaskController.cs:
//do not dispose. otherwise, we can get exception that DbContext is disposed
task.Execute(true, false);
Done.
Ticket 971.
Thanks!
Same error.
Can you send me an example of your reminder plugin?
No, Im not!
My code is that simple (see reply above).
The exception is thrown at nop's endrequest method.
Hi Iliyan!
The Autofac and Autofac.Integration.Mvc references were added to project, but the same error still occurs.
Hi.
Im not using Autofac. My custome role makes simple processing justing for testing.
This is the code:
public virtual IList<CustomerReminderInfo> GetCustomerReminderInfos(TimeSpan conditionMetDataEarlierThan, TimeSpan conditionMetDateLaterThan, int storeId)
{
try
{
var customerReminderInfos = new List<CustomerReminderInfo>();
var finishedOrders = from a in _orderRepository.Table
join b in _shipmentRepository.Table on a.Id equals b.OrderId
join c in _orderItemRepository.Table on a.Id equals c.OrderId
where b.DeliveryDateUtc != null
&& a.OrderStatusId == 30
&& DateTime.Now > DbFunctions.AddMinutes(b.DeliveryDateUtc, (int)conditionMetDataEarlierThan.TotalMinutes)
&& b.DeliveryDateUtc >= DbFunctions.AddMinutes(DateTime.Now, (int)conditionMetDateLaterThan.TotalMinutes * -1)
&& _productReviewRepository.Table.Where(p => p.CustomerId == a.CustomerId && p.ProductId == c.ProductId).Count() == 0
select new { Order = a, Data = (DateTime)b.DeliveryDateUtc };
foreach (var order in finishedOrders)
{
var customerReminderInfo = new CustomerReminderInfo()
{
Customer = order.Order.Customer,
ReminderMessageId = order.Order.Id,
RuleConditionMetDate = order.Data,
Tokens = new List<Token>(),
StoreId = storeId
};
customerReminderInfos.Add(customerReminderInfo);
}
return customerReminderInfos;
}
catch (Exception ex)
{
_loggerService.InsertLog(LogLevel.Error, ex.Message, ex.StackTrace);
return null;
}
}