[RSS Feed/News] Unnesessary query for non-mirrored media items

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
In XF\Pub\Controller\Media::actionIndex
PHP:

$mirrorAttachment = $mediaItem->MirrorAttachment;

This does gall get getMirrorAttachment on the entity which moreless unconditionally issues a query:
PHP:

Code:
public function getMirrorAttachment()
{
    $attachment = $this->Attachment;
    if (!$attachment)
    {
        return null;
    }

    return $this->_em->findOne('XF:Attachment', [
        'data_id' => $attachment->data_id,
        'xfmg_is_mirror_handler' => 1
    ]);
}
...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom