r7-labs / R7.News

Taxonomy-driven news subsystem for DNN Platform
GNU Affero General Public License v3.0
2 stars 3 forks source link

GetFirstPageInternal call causes SQL syntax error #8

Closed roman-yagodin closed 7 years ago

roman-yagodin commented 8 years ago

Event log entry:

   в System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   в System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   в System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   в System.Data.SqlClient.SqlDataReader.get_MetaData()
   в System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   в System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   в System.Data.SqlClient.SqlCommand.ExecuteScalar()
   в PetaPoco.Database.ExecuteScalar[T](String sql, Object[] args)
   в R7.News.Data.NewsDataProvider.ExecuteSpScalar[T](String spName, Object[] args)
   в R7.News.Data.NewsRepository.GetNewsEntriesByTerms_Count(Int32 portalId, Boolean checkNow, DateTime now, Int32 minThematicWeight, Int32 maxThematicWeight, Int32 minStructuralWeight, Int32 maxStructuralWeight, IList`1 terms)
   в R7.News.Stream.ViewModels.StreamViewModel.GetFirstPageInternal(Int32 pageSize, Boolean checkNow, DateTime now)
   в R7.News.Stream.ViewModels.StreamViewModel.c__AnonStorey0.<>m__0(CacheItemArgs c)
   в DotNetNuke.Common.Utilities.DataCache.GetCachedDataFromRuntimeCache(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired)
roman-yagodin commented 7 years ago

Caused by empty tags list.

roman-yagodin commented 7 years ago

Another stacktrace after fixing GetNewsEntriesByTerms_Count(), now it is in GetNewsEntriesByTerms_Count():

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at PetaPoco.Database.d__2`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at PetaPoco.Database.Fetch[T](String sql, Object[] args)
   at R7.DotNetNuke.Extensions.Data.Dal2DataProvider.GetObjectsFromSp[T](String spName, Object[] args)
   at R7.News.Data.NewsRepository.GetNewsEntriesByTerms_FirstPage(Int32 portalId, Int32 pageSize, Boolean checkNow, DateTime now, Int32 minThematicWeight, Int32 maxThematicWeight, Int32 minStructuralWeight, Int32 maxStructuralWeight, IList`1 terms)
   at R7.News.Stream.ViewModels.StreamViewModel.GetFirstPageInternal(Int32 pageSize, Boolean checkNow, DateTime now)
   at R7.News.Stream.ViewModels.StreamViewModel.c__AnonStorey0.<>m__0(CacheItemArgs c)
   at DotNetNuke.Common.Utilities.DataCache.GetCachedDataFromRuntimeCache(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired)