As designed Wrong function being called

TickTackk

Well-known member
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;
    }
 
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.
 
Back
Top Bottom