[NOP 4.40.3] Ajax error when Reward Points enabled

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Reward points were enabled and points were set for Registration.

After few users registered, if we try to view Customer details in Admin for customer who received reward points for registration (Select customer for Edit from customer list), a Javascript error is displayed with content as follows:
DataTables warning: table id=customer-rewardpoints-grid - Ajax error. For more information about this error, please see http://datatables.net/tn/7


The Reward points history is not displayed for the customer.

No customisations have been applied to the site. Everything is essentially "out of the box"
2 years ago
It works fine on a clean installation, I just checked it. Probably something wrong with your configuration.
2 years ago
Try again, and then check your System > Log to see if more detailed error messages.
2 years ago
Thank you. I checked the log.

When trying to display the Customer Edit page, the following request is made:
https://<domain>/Admin/Customer/RewardPointsHistorySelect?CustomerId=<ID>


This logs the following error ... BTW, could this by any chance be a MySQL vs SQL Server thing?:

System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'count')
   at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
   at MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32 index, MySqlField field, IMySqlValue valObject)
   at MySql.Data.MySqlClient.ResultSet.ReadColumnData(Boolean outputParms)
   at MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlDataReader.Read()
   at System.Data.Common.DbDataReader.ReadAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at LinqToDB.Linq.QueryRunner.ExecuteQueryAsync[T](Query query, IDataContext dataContext, Mapper`1 mapper, Expression expression, Object[] ps, Object[] preambles, Int32 queryNumber, Func`2 func, TakeSkipDelegate skipAction, TakeSkipDelegate takeAction, CancellationToken cancellationToken)
   at LinqToDB.Linq.QueryRunner.ExecuteQueryAsync[T](Query query, IDataContext dataContext, Mapper`1 mapper, Expression expression, Object[] ps, Object[] preambles, Int32 queryNumber, Func`2 func, TakeSkipDelegate skipAction, TakeSkipDelegate takeAction, CancellationToken cancellationToken)
   at LinqToDB.Linq.ExpressionQuery`1.GetForEachAsync(Action`1 action, CancellationToken cancellationToken)
   at LinqToDB.AsyncExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken token)
   at System.Linq.AsyncIQueryableExtensions.ToPagedListAsync[T](IQueryable`1 source, Int32 pageIndex, Int32 pageSize, Boolean getOnlyTotalCount)
   at Nop.Services.Orders.RewardPointService.GetRewardPointsHistoryAsync(Int32 customerId, Nullable`1 storeId, Boolean showNotActivated, Nullable`1 orderGuid, Int32 pageIndex, Int32 pageSize)
   at Nop.Web.Areas.Admin.Factories.CustomerModelFactory.PrepareRewardPointsListModelAsync(CustomerRewardPointsSearchModel searchModel, Customer customer)
   at Nop.Web.Areas.Admin.Controllers.CustomerController.RewardPointsHistorySelect(CustomerRewardPointsSearchModel searchModel)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WebMarkupMin.AspNetCore5.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore5.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore5.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 125
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Nop.Services.Authentication.AuthenticationMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Nop.Services.Installation.InstallUrlMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Nop.Services.Common.KeepAliveMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
2 years ago
RomanovM wrote:
It works fine on a clean installation, I just checked it. Probably something wrong with your configuration.


Thank you for your response. Can you confirm if you tried this on a MySQL backend?
2 years ago
Well, I see now. Look at this issue.
2 years ago
RomanovM wrote:
Well, I see now. Look at this issue.


Thank you for the reference. I updated the mySql.Data.dll to the latest version (8.0.25) and the issue appears to be resolved.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.