• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Delete Type missing

batpool52!

Well-known member
#1
In XenGallery_Model_InlineMod_Media
PHP:
    public function undeleteMedia(array $mediaIds, array $options = array(), &$errorKey = '', array $viewingUser = null)
    {
        $media = $this->getMediaData($mediaIds);

        if (empty($options['skipPermissions']) && !$this->canDeleteMediaData($media, $errorKey, $viewingUser))
        {
            return false;
        }

        $this->_updateMediaMediaState($media, 'visible', 'deleted');

        return true;
    }
should be
PHP:
    public function undeleteMedia(array $mediaIds, array $options = array(), &$errorKey = '', array $viewingUser = null)
    {
        $media = $this->getMediaData($mediaIds);

        if (empty($options['skipPermissions']) && !$this->canDeleteMediaData($media, $options['delete_type'], $errorKey, $viewingUser))
        {
            return false;
        }

        $this->_updateMediaMediaState($media, 'visible', 'deleted');

        return true;
    }
 

Chris D

XenForo developer
Staff member
#4
The fix is to replace $options['delete_type'] in your fix with simply 'soft'. We don't actually need to consider hard delete permissions here. If you can soft delete the media, then you should be able to undelete it.
 
Top