Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Manage Categories opens very S-L-O-W
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

@clorne
Can you provide the catalog_category_entity table dump before your fix and after? It would be great if you attached them to the issue http://www.magentocommerce.com/bug-tracking/issue?issue=6853

 
Magento Community Magento Community
Magento Community
Magento Community
 
LUKA netconsult
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-29
Frankfurt am Main (DE)
 

Well I tracked down the problem and posted a solution in another thread:
http://www.magentocommerce.com/boards/viewthread/38818/P30/#t156687

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ben Marks
Moderator
 
Avatar
Total Posts:  452
Joined:  2008-10-09
Charleston, SC
 

The patch works!  Excellent find, AlexH!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ben Marks
Moderator
 
Avatar
Total Posts:  452
Joined:  2008-10-09
Charleston, SC
 

All credit to AlexH for finding the solution!

For those of you who would like to implement the patch the proper way, here are the config nodes and class:

<?xml version="1.0"?>
<config>
    <global>
        <
models>
            <
catalog_resource_eav_mysql4>
                <
rewrite>
                    <
category_collection>[NAMESPACE]_Catalog_Model_Resource_Eav_Mysql4_Category_Collection</category_collection>
                </
rewrite>
            </
catalog_resource_eav_mysql4>
        </
models>
    </global>
</
config>

<?php
/**
 * Category resource collection - override to patch bug #15359
 * http://www.magentocommerce.com/bug-tracking/issue?issue=6853
 */
class [NAMESPACE]_Catalog_Model_Resource_Eav_Mysql4_Category_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection
{

    
/**
     * Enter description here...
     *
     * @param boolean $printQuery
     * @param boolean $logQuery
     * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection
     */
    
public function load($printQuery false$logQuery false)
    
{
        
//Patch from AxelH http://www.magentocommerce.com/boards/viewthread/38818/P30/#t156687
        
if ($this->isLoaded()) {
            
return $this;
        
}
        
//end patch

        
if ($this->_loadWithProductCount{
            $this
->addAttributeToSelect('all_children');
            
$this->addAttributeToSelect('is_anchor');
        
}

        parent
::load($printQuery$logQuery);

        if (
$this->_loadWithProductCount{
            $this
->_loadProductCount();
        
}

        
return $this;
    
}
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

This smaller code would be less pain to upgrade wink

<?php
/**
 * Category resource collection - override to patch bug #15359
 * http://www.magentocommerce.com/bug-tracking/issue?issue=6853
 */
class [NAMESPACE]_Catalog_Model_Resource_Eav_Mysql4_Category_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection
{
    
/**
     * Load collection
     *
     * @param bool printQuery
     * @param bool logQuery
     * @return [NAMESPACE]_Catalog_Model_Resource_Eav_Mysql4_Category_Collection          
     */
    
public function load($printQuery false$logQuery false)
    
{
        
if ($this->isLoaded()) {
            
return $this;
        
}
        
return parent::load($printQuery$logQuery);
    
}
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Ben Marks
Moderator
 
Avatar
Total Posts:  452
Joined:  2008-10-09
Charleston, SC
 

@Anton - you are correct smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
LUKA netconsult
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-29
Frankfurt am Main (DE)
 
blueben - 16 July 2009 07:50 AM

The patch works!  Excellent find, AlexH!

Good to see that this also helps someone else wink
That’s why I love OSS that much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

AxelH the correction works well.

A good piece of detection, I had been looking for the error for days but got nowhere close.

Thank you for sharing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
umpa
Jr. Member
 
Total Posts:  7
Joined:  2009-03-06
 

THX AxelH work here as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
netra4u
Jr. Member
 
Total Posts:  8
Joined:  2008-07-16
 

Could someone tell me how to apply patch ?

which file ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
LUKA netconsult
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-29
Frankfurt am Main (DE)
 
netra4u - 17 July 2009 10:49 PM

Could someone tell me how to apply patch ?

which file ?

Sure,

The fast way:
Download the “magento_categoryfix.zip” file from this post’s attachment:
http://www.magentocommerce.com/boards/viewthread/38818/P30/#t156687 and unzip it (there is on file in it named magento_categoryfix.patch.

To apply it (on Linux/Unix machines) cd to your magento directory and execute the following command (Where <path> is the path where you unzipped the patch):
cat <path>/magento_categoryfix.patch | patch -p1

That’s it.
I don’t use Windows, so I don’t know what tools are available for this platform. If you’re using Eclipse or Zend Studio you could use the the Team -> Apply Patch context menu of the project.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kromack
Jr. Member
 
Total Posts:  4
Joined:  2009-04-23
 

Hello, I have this issue when I save product, the page takes between 60 and 90 sec to load.

I have replaced directly in the core file the load function by :

public function load($printQuery false$logQuery false)
    
{
        
if ($this->isLoaded()) {
            
return $this;
        
}
        
return parent::load($printQuery$logQuery);
    
}

I have disabled, the refreshed the cache, but nothing change.

What I’m doing wrong ? I know I’m hacking the core by this way, but we don’t plan to upgrade magento for the moment.

Anybody can help me ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2