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

As designed Wrong function being called

batpool52!

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

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

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

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

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

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

        return true;
    }
 

Chris D

XenForo developer
Staff member
#2
I disagree.

$media is an array of media items.

The 'canApproveMediaData()' function takes an array of media items.
The 'canApproveMedia()' function takes an array which is a single media item.

Therefore 'canApproveMediaData()' is the appropriate function to call here.