1. 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

Discussion in 'Media Gallery Resolved Bugs' started by batpool52!, Nov 18, 2015.

  1. batpool52!

    batpool52! 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;
        }
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
    batpool52! likes this.

Share This Page