HomeHome Product Discus... Product Discus...SmithCartSmithCartBug in "Manage Products" Smith Cart 3.98Bug in "Manage Products" Smith Cart 3.98
Previous
 
Next
New Post
4/8/2011 12:59 PM
 

We run into a problem of occasionally products not showing in "manage products". The cause seems to be in Smith_productByFilter store procedure.  Since we have multiple portals running smith cart, there are products from different  portalID. When the page attempt to load, in some cases, the first set of products (via "pagenation" in the procedure) that queried does not contain products from that particular portal. when this happens the list is empty. Our solution was to when we run the initial SELECT command, we only query the products with the associated portalID so that the "pagenation" process will involves only the portal's products, thus will not be empty unless there is no product.

I was wondering if this bug was ever addressed or not...

 
New Post
4/8/2011 2:11 PM
 

I just tried to re-produce this error on my test portal and was unable to recreate the error but I may not have the exact same configuration as you.  Can you login to our test site http://www7.smith-consulting.com/ and try to replicate the error. This will determine if the issue is with the latest version of the cart or an issue with your specific dnn portal/cart install.


Please send an email to support@smith-consulting.com if you need a login.

 

Thanks!

Kevin

 
New Post
4/11/2011 7:37 AM
 

I need at least TWO portals to reproduce the error. Can you provide two test portals (within ONE DNN installation)?

 
New Post
4/11/2011 2:38 PM
 
To clarify, is the issue that the products from one portal are not showing up in the other portal's "manage product"? Or that the products from one portal are showing up in the other portal?

Kevin
 
New Post
4/12/2011 5:36 AM
 

Let's say product 1 through 100 belongs to portal A, and product 101 through 200 belongs to portal B, and portal A and B are both hosted under the same DNN installation.

Products 1 through 100 of portal A all has sort order "0" assigned. Products of 101 through 200 of portal B all has sort order "10" assigned.

Let's say that "manage products" page list fist 25 products by default.

Smith_productByFilter stored procedure grabs all the products from the database (both portal A and portal B) sorted by sort order value assigned then grab the first 25 products to be displayed.

Portal A has no issue since their products has lower sort order number...so their products are shown at the beginning of the product data queries.

Portal B, on the other hand, will have the problem. because Smith_productByFilter will query products of both portal A and portal B then grab the first 25 products which consists of products from portal A. THEN it tries to find if there is any products from Portal B...which is none....so the "manage products" list NONE of the product in the page.

Our solution to this issue was to modify the stored procedure so that it

query the list of the products belongs to portal B by filtering the portalID first THEN grab the first 25 products from the queried data.

I'm inserting our modified procedure below. Please compare with yours. I bolded the area we modified:

 

 

ALTER PROCEDURE [dbo].[Smith_productByFilter]

    @Page int,

    @RecsPerPage int,

    @sortfield varchar(50),

    @sortorder varchar(10),

    @filter varchar(50),

    @searchtext varchar(50) ,

    @tabModuleId int,

    @PortalId int

as

 

CREATE TABLE #TempItems

(

                ProductAutoID int IDENTITY,

                ProductID int

)

DECLARE @SearchSQL varchar(5000)

 

if(@Filter='All')

                Begin

                                 SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) select P.ProductID from Smith_Products P left outer join ' +

                                                                                                                'Smith_Category  C on C.CategoryID=P.CategoryID'+

                                                                                                                ' where ( p.TabModuleId =  ' + CAST ( @tabModuleId AS VARCHAR(10)) + '  OR  p.Share = 1 )  and  p.PortalID = ' + cast(@PortalId as varchar(100)) + '  and  P.LogicallyDeleted !=''1''' 

                                                   

                                                   

                                 if( @sortfield='CategoryName')

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by C.' +@sortfield+' '+ @sortorder

                                 else

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by P.'+@sortfield+' '+ @sortorder

                End

else if(@Filter='CategoryName')

                Begin

                                SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) select P.ProductID from Smith_Products P inner join ' +

                                                                                                                ' Smith_CategoryProduct CP on CP.ProductID=P.ProductID inner join Smith_Category C on C.CategoryID=CP.CategoryID'+

                                                                                                                ' where ( p.TabModuleId =  ' + CAST ( @tabModuleId AS VARCHAR(10)) + '  OR  p.Share = 1 ) and P.LogicallyDeleted !=''1'' and  p.PortalID = ' + cast(@PortalId as varchar(100)) + ' and ( C.'+@filter+'  Like ''%' + @searchtext + '%'')'

                                 if( @sortfield='CategoryName')

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by C.' +@sortfield+' '+ @sortorder

                                 else

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by P.'+@sortfield+' '+ @sortorder

                End

else

                Begin

                                SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) select p.ProductID from Smith_Products P ' +

                                                                                                                ' where ( p.TabModuleId =  ' + CAST ( @tabModuleId AS VARCHAR(10)) + '  OR  p.Share = 1 )  and  p.PortalID = ' + cast(@PortalId as varchar(100)) + '  and P.LogicallyDeleted !=''1'' and ( P.'+@filter+'  Like ''%' + @searchtext + '%'')'

                                 if( @sortfield='CategoryName')

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by C.' +@sortfield+' '+ @sortorder

                                 else

                                                SELECT @SearchSQL=@SearchSQL+' '+' order by P.'+@sortfield+' '+ @sortorder

                End

 

EXECUTE(@SearchSQL)

DECLARE @FirstRec int, @LastRec int

SELECT @FirstRec = (@Page - 1) * @RecsPerPage

SELECT @LastRec = (@Page * @RecsPerPage + 1)

 

SELECT p.*,c.categoryname, TotalRecords=(

                 SELECT COUNT(*)

                 FROM #TempItems TI),

       MoreRecords =

                (

                 SELECT COUNT(*)

                 FROM #TempItems TI

                 WHERE TI.ProductAutoID >= @LastRec

                )

FROM Smith_Products P left outer join 

  Smith_Category  C on C.CategoryID=P.CategoryID RIGHT OUTER JOIN

  #TempItems T ON P.ProductID  = T.ProductID

WHERE ProductAutoID > @FirstRec AND ProductAutoID < @LastRec and p.PortalID = @PortalId

--Order By P.SortOrder ,  P.ModelName

 

 

 
New Post
4/12/2011 1:34 PM
 
PortalID was added as a where condition in cart version 4.1. Thats why I was having trouble reproducing it on our www7 test portal. If possible, its always a good idea to be running the latest version of the cart to take advantage of any bug fixes. Thanks for reporting this issue!!

Kevin
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartBug in "Manage Products" Smith Cart 3.98Bug in "Manage Products" Smith Cart 3.98