Best Bets With Commerce Category Bug



There seems to be an outstanding Find bug in best bets, when used with commerce, if the user sets up a best bet selecting a category as the commerce content (instead of a page or variant). This results in a cast error, and also prevents the Epi Find UI from loading correctly (so the invalid best bet can't be deleted through the Find UI).

Is there a fix for this available, and if not, do you have a script we can use to delete all best bets from the DB directly?


Edited, Aug 04, 2016 18:54

I ended up deletiing all the Best Bets from the DB, as it's just a dev environment so no great shakes to lose them all. This worked fine for me, but obviously hard deleting stuff out of the CMS DB comes with risk attached. Posting the script here is case it's useful to someone, but it's quite clearly unsafe so only intended for use on dev databases; back up DB before use, check the items it will be deleting before running it, cross fingers and hope for the best (bets)

DECLARE @ids table (id int IDENTITY, val int not null)
	SELECT pkId FROM tblBigTable 
	WHERE ItemType LIKE '%BestBet%'

DECLARE @number int
DECLARE @bestBetId int
DECLARE @count int
SELECT @count = COUNT(*) FROM @ids i

PRINT '' + CAST(@count AS nvarchar) + ' items to process'

SET @number=1

WHILE @number <= @count BEGIN

	PRINT 'Processing item ' + 
		CAST(@number AS nvarchar) + ' of ' + 
		CAST(@count AS nvarchar)

	SELECT @bestBetId = val FROM @ids i WHERE

	DELETE FROM tblBigTableReference WHERE pkId=@bestBetId
	DELETE FROM tblBigTableReference WHERE RefIdValue=@bestBetId
	DELETE FROM tblBigTable WHERE pkId=@bestBetId
	DELETE FROM tblBigTableIdentity WHERE pkId=@bestBetId

	SET @number = @number + 1

Aug 05, 2016 11:04


This bug is fixed in Find Commerce 9.6.1 and will be released next week


Aug 05, 2016 22:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.