Page 1 of 1

LOG warning when adding child categories

Posted: Thu Nov 20, 2014 1:08 am
by quangpld
Hi,

I try to create a new category which including some child categories.
The new category is also added to the existing one Primary Nav.
In the log console, I see many warnings (interval warning after each 30 seconds):

Code: Select all

[ WARN] 12:56:54 SolrIndexDaoImpl - Category circular reference identified for category id 2


I search the code which issues the warning: org.broadleafcommerce.core.search.daoSolrIndexDaoImpl.readFullCategoryHierarchy(Map<Long, Set<Long>> categoryHierarchy, Set<Long> builtCategories)

Code: Select all

for (ParentCategoryByCategory item : results) {
    //only the sandbox child
    Long childSandBoxVal = sandBoxHelper.getSandBoxVersionId(em, CategoryImpl.class, item.getChild());
    if (childSandBoxVal == null) {
        childSandBoxVal = item.getChild();
    }
   
    if (builtCategories.contains(childSandBoxVal)) {
        LOG.warn("Category circular reference identified for category id " + childSandBoxVal);
        continue;
    }
}


So, what's the meaning of this warning?
What's wrong with the child or parent categories?
Thanks, :)

Re: LOG warning when adding child categories

Posted: Tue Dec 02, 2014 8:16 pm
by phillipuniverse
The circular reference is because the child category has a child that refers to the parent category, thus creating a circle.

Category1 -> Category2 -> Category1 -> .......

In your case, you are adding Primary Nav to some child category whose parent is also Primary Nav.