Fixed Delete category don't delete deleted resource or moderated resource

truonglv

Well-known member
As title. When try to delete an category all resources which has `deleted` or `moderated` still exists.
Because in ControllerAdmin_Category line 211:
PHP:
$resources = $this->_getResourceModel()->getResources(array('resource_category_id' => $id), array('limit' => 100));

And in Model_Resource line 259 to 267:
PHP:
if (isset($conditions['deleted']) || isset($conditions['moderated']))
        {
            $sqlConditions[] = $this->prepareStateLimitFromConditions($conditions, 'resource', 'resource_state');
        }
        else
        {
            // sanity check: only get visible resources unless we've explicitly said to get something else
            $sqlConditions[] = "resource.resource_state = 'visible'";
        }
Its always include `resource_state` = 'visible` if you don't include special conditions. So....
:)
 
Back
Top Bottom