Kentico Product table structure - possible orphansd SKUs

Danny Winbourne asked on October 5, 2021 20:36

If I run the below query against my database, I can see 3 products listed (so all 3 have the same SKUNumber)

select * from COM_SKU
where SKUNumber = 'myid'

2 of the results have "SKUEnabled" set to false, whilst the 3rd is set to true. I am trying to find these other products in the CMS, but I am unable to do so.

If I run the below query, I can only see the enabled product listed, so it appears to be orphaned.

select * from CMS_Tree T
inner join COM_SKU S on S.SKUID = T.NodeSKUID
where SKUNumber = 'myid' 

Is there another way to find these "orphaned" SKU items in the CMS so I can delete them?

Recent Answers


Danny Winbourne answered on October 5, 2021 21:14

I have another example where I have 13 items with the same SKU in the COM_SKU table, 2 of which are enabled, but only one related row in the CMS_Tree table.

0 votesVote for this answer Mark as a Correct answer

Danny Winbourne answered on October 5, 2021 21:39

What I think is happening, is that the client is copying an existing SKU item in the CMS (which in my case creates 3 records in COM_SKU, I think one per enabled language variant I have), and then later deletes it. The COM_SKU records are left behind, but the CMS_Tree record gets removed?

Is this expected behaviour? I can of course write a script to remove any orphaned records, but I feel this might keep happening.

0 votesVote for this answer Mark as a Correct answer

Danny Winbourne answered on October 6, 2021 09:19

I have managed to work out how to view these SKUs. I need to enable "Standalone SKUs" in the E-commerce Settings. I can then see these in the product's application.

I might open a support ticket regarding deleting items, as I feel the SKU should go too, but it may be intended functionality.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.