View Issue Details

IDProjectCategoryView StatusLast Update
0002209OXID eShop (all versions)4.09. SEO, SEO URLpublic2012-12-10 13:35
Reporterandreas_ziethen Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.4.4 revision 30554 
Fixed in Version4.4.5 revision 31315 
Summary0002209: removing products from category results in complete expire of SEO URLs - heavy performance issue
DescriptionIn class ajaxComponent in file /admin/inc/category_main.inc.php there's a function removearticle() which is called each time you remove a product from a category via the admin ajax popup.

This function at the end calls:
$this->resetArtSeoUrl( $sAdd );

But: $sAdd is NOT defined! This results in a complete reset of ALL entries in table oxseo. This again results in massive performance problems in big shops. An immediate reset of 150.000 entries in OXSEO in a shop with heavy traffic does kill the database server for a while cause it results in thousands and thousands of write processes to oxseo table.

I am not sure if this is the only place where this happens. It might be a good idea to check all the other calls of oxajax::resetArtSeoUrl() as well for the existance of the $aArtIds param.
You could also do something like this:

public function resetArtSeoUrl( $aArtIds )
{
        if( !is_array($aArtIds) && empty($aArtIds))
            return;

        if ( !is_array( $aArtIds ) ) {
            $aArtIds = array( $aArtIds );
        }

        foreach ( $aArtIds as $sArtId ) {
           oxSeoEncoder::getInstance()->markAsExpired( $sArtId );
        }
}
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

andreas_ziethen

2010-11-12 10:35

reporter   ~0003688

In addition:
function resetArtSeoUrl() does actually exist twice:

oxadminview::resetArtSeoUrl() = ajaxListComponent::resetArtSeoUrl()

so take care to fix both ... - or even better: put it into a core class. ;-)

rimvydas_paskevicius

2010-11-12 16:55

reporter   ~0003691

Added additional checking to function oxajax::resetArtSeoUrl() and oxadminview::resetArtSeoUrl() - if passed parameter to function is empty, no call to oxSeoEncoder::markAsExpired() will be executed.