Continuing Orphaned Items

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Continuing Orphaned Items

Post by heinscott » Wed Nov 26, 2008 2:20 pm

Hello...
I'm again seeing items in my orphaned items list that have not been edited in any way. We have been adding new product to our catalog, but, existing items have not been edited at all. This is for a few different items... whether actual product, or components of a kit. There doesn't seem to be any consistent data across these items either. All showed either positive in stock levels, inv tracking disabled... The only thing that is consistent, is that for some reason, they lost the categories they were associated with.
Can someone please help me out with this? I have to check the orphaned items table every day to make sure nothing is in it again!
Thanks for the help.

Scott

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Continuing Orphaned Items

Post by heinscott » Wed Nov 26, 2008 2:42 pm

Hello again... It seems that I have figured out why the problem is occurring, but, not how to fix it :(
Here is an example:
Whenever we have a product where the ProductId is equal to a Category with the same CategoryId
(1439 Polaris Ball Bearing (ATV-380-360) PRODUCT 1439 Solar Pool Cover CATEGORY)
and we delete the Category, not only will all the Node associations for that category get deleted, but so will the ones for the Product. It seems that the NodeTypeId is not being checked during the delete process.
Any help on this???
Thanks again,

Scott

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Continuing Orphaned Items

Post by AbleMods » Wed Nov 26, 2008 3:12 pm

heinscott wrote:Whenever we have a product where the ProductId is equal to a Category with the same CategoryId...
I don't understand. Do you mean when you delete ProductId 482 and you have a category that also happens to have Id 482, the nodes for the whole category are getting deleted along with the one product?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Continuing Orphaned Items

Post by heinscott » Wed Nov 26, 2008 3:15 pm

Yes, that is exactly what I mean. Just to test, I ran the query "Select A.ProductId, A.Name, B.Name from ac_Products A INNER JOIN ac_Categories B ON A.ProductId = B.CategoryId", and got a list of all products/categories with matching ids. Then, I deleted one of the categories (that we didn't have products in yet), and sure enough... The product showed right up in the orphaned items list.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Continuing Orphaned Items

Post by heinscott » Wed Nov 26, 2008 3:17 pm

Actually, I guess we're having the opposite problem from what you described... We delete the category, and the product loses it's categories.

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Continuing Orphaned Items

Post by nickc » Wed Nov 26, 2008 3:24 pm

Your initial report sounded familiar...

http://bugs.ablecommerce.com/show_bug.cgi?id=7056

- now seems that things are still not quite right with deletion cascade in the CatalogNodes table.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Continuing Orphaned Items

Post by jmestep » Wed Nov 26, 2008 3:56 pm

A co-worker had that problem with a site he did and was never able to pinpoint the problem since the pages were heavily customized.
Draneb has reported the problem also.
This is the first clue as to why it is happening, which is good.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Continuing Orphaned Items

Post by mazhar » Thu Nov 27, 2008 6:35 am

This is due to the following bug
http://bugs.ablecommerce.com/show_bug.cgi?id=7056
Currently this is fixed in AC7.1 but not yet fixed in AC7.0.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Continuing Orphaned Items

Post by jmestep » Thu Nov 27, 2008 8:19 am

I know Able recommended waiting for 7.2 unless we needed new international stuff in 7.1. This is a pretty serious bug. Will it be fixed in 7.0? If not, then we should probably upgrade to 7.1?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Continuing Orphaned Items

Post by mazhar » Thu Nov 27, 2008 12:31 pm

If you people think that this fix is critical for AC7 then better some one from you should throw a ticket request.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Continuing Orphaned Items

Post by heinscott » Fri Nov 28, 2008 11:10 am

Either that, or would it be possible to get the code for the cascade category delete? I wouldn't mind, for the time being, creating a custom fixed method to handle the delete for me.
I'm sure I could come up with something, but would rather make sure that I'm catching all the related data.
Thanks Mazhar.

Scott

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Continuing Orphaned Items

Post by mazhar » Fri Nov 28, 2008 11:20 am

It would be better to open a ticket.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Continuing Orphaned Items

Post by heinscott » Wed Dec 03, 2008 9:14 am

In case this helps anyone while waiting for the fix in 7.1, I've modified the delete method for a Category type CatalogNode to re-create any product types after the Category delete. This will take care of the orphaned products.
In the browse.aspx.cs file (Admin/Catalog), find the DoDelete method. Change the case CatalogNodeType.Category in the switch statement to:

Code: Select all

case CatalogNodeType.Category:
                List<int> Categories = new List<int>();
                List<short> OrderByList = new List<short>();
                Category category = CategoryDataSource.Load(catalogNodeId);
                if (category != null)
                {
                    CatalogNodeCollection cnc = CatalogNodeDataSource.LoadForCriteria("CatalogNodeId = " + catalogNodeId + " AND CatalogNodeTypeId = 1");
                    foreach (CatalogNode cn in cnc)
                    {
                        Categories.Add(cn.CategoryId);
                        OrderByList.Add(cn.OrderBy);
                    }
                    category.Delete();
                    for (int i = 0; i < Categories.Count; i++)
                    {
                        CatalogNode cn = new CatalogNode(Categories[i], catalogNodeId, CatalogNodeType.Product, OrderByList[i], true);
                        cn.Save();
                    }
                }
                break;
Hope this is helpful.

Scott

Post Reply