Close

Profile: IvanSlater

Avatar

User posts

Bugs
9 years ago

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?

9 years ago

How to change this code to nop core? 

9 years ago

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>();
        }
    }
}



in plugin install and uninstall method, just include:


_permissionService.InstallPermissions(new XXXPermissionProvider());


and 


_permissionService.UninstallPermissions(new XXXPermissionProvider());


Thanks!!!

9 years ago

Dynamic prices should be dynamiclly updated inside add to cart modal window.

Custom Rules
9 years ago

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);


But I cant find the respective changeset in nop's codeplex.

Custom Rules
9 years ago

Done.

Ticket 971.

Thanks!

Custom Rules
9 years ago

Same error.

Can you send me an example of your reminder plugin?

Custom Rules
9 years ago

No, Im not!

My code is that simple (see reply above).

The exception is thrown at nop's endrequest method.

Custom Rules
9 years ago

Hi Iliyan!

The Autofac and Autofac.Integration.Mvc references were added to project, but the same error still occurs.

Custom Rules
9 years ago

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;
            }
        }