Fixed Moving Featured Resources

  • Thread starter Thread starter Syndol
  • Start date Start date
S

Syndol

Guest
When a featured resource is moved to a new category it no longer is featured even though it is still in the feature table.
Changing the condition in the Category datawriter resourceUpdate() function from:
Code:
if ($resource->isUpdate() && $resource->isChanged('resource_state'))
{
    $this->updateFeaturedCount();
}
to:
Code:
if ($resource->isUpdate() && ($resource->isChanged('resource_state') || $resource->isChanged('resource_category_id')))
{
    $this->updateFeaturedCount();
}
seems to fix this.
 
Slightly different fix (I basically just put the code up a bit), but fixed now. Thanks. :)
 
Back
Top Bottom