Hi,
If I have notification wich clears the productlist in combination with a filter I get an SQL error. Is there a way to avoid it?
1. Create a notification subscriber:
[Subscribe(Dynamicweb.Notifications.eCommerce.ProductList.BeforePaging)]
public class BeforeProductListRendering : NotificationSubscriber
{
public override void OnNotify(string notification, NotificationArgs args)
{
(args as Dynamicweb.Notifications.eCommerce.ProductList.BeforePagingArgs).Products.Clear();base.OnNotify(notification, args);
}
}
2. Navigate to a product list with filter search
An error occured while attaching module (Dynamicweb.Frontend.Content)
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ')'.
vid System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
vid System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
vid System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
vid System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
vid System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
vid System.Data.SqlClient.SqlDataReader.get_MetaData()
vid System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
vid System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
vid System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
vid System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
vid System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
vid System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
vid System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
vid Dynamicweb.Database.CreateDataReader(String sql, String database, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
vid Dynamicweb.Database.CreateDataReader(String sql, String database)
vid Dynamicweb.eCommerce.Products.ProductCollection.LoadStocks()
vid Dynamicweb.eCommerce.Frontend.Frontend.ListProducts(ProductCollection products, String groupsIdent, Boolean hasBeenSorted)
vid Dynamicweb.eCommerce.Frontend.Frontend.EcomRender()
vid Dynamicweb.eCommerce.Frontend.Frontend.GetContent()
vid Dynamicweb.Frontend.Content.getModule(DataRow& ParagraphRow)
ClientConnectionId:cd7830f6-7871-4236-8f3c-deeebd0c727f