As designed Not possible to rate when no download-permission

bart

Active member
When you don't use the download-function in the RM.

When you set a permission to download to "no" (not set).

And set the option "Require Downloading Before Rating" to "no".

Then you should be able to rate a resource, but you're not.

I traced the error to:

Code:
    public function canRateResourceIfDownloaded(array $resource, array $category, &$errorPhraseKey = '', array $viewingUser = null, array $categoryPermissions = null)
    {
        $this->standardizeViewingUserReferenceForCategory($category, $viewingUser, $categoryPermissions);

        if ($resource['resource_state'] != 'visible')
        {
            return false;
        }

        if (!$viewingUser['user_id'])
        {
            return false;
        }

        if ($viewingUser['user_id'] == $resource['user_id'])
        {
            return false;
        }

        if (!$this->canDownloadResource($resource, $category, $null, $viewingUser, $categoryPermissions))
        {

!!!

if "requireDownloadToRate" is false, then this function should be bypassed.

!!!


            return false;
        }

        return XenForo_Permission::hasContentPermission($categoryPermissions, 'rate');
    }
 
First off, at the very least, I don't think this should change for backwards compatibility reasons. This is a pretty big change as you would suddenly potentially have people rating that weren't able to before.

But further, while I understand what you want, I don't think it completely makes sense. Why should someone be able to rate/review a resource if they have no permission to actually access it? The rate without download situation is mostly to allow people to set up for cases where the file may have been available elsewhere, to save whatever wasted time downloading may create. I don't really understand what your use case is.

Regardless, because of the BC break reasons, it might be best for you to make the necessary changes for your needs.
 
I am using the resource manager for classifieds, a library and for displaying events. In none of them downloads have anything to do with it and are not possible. But for rating to be possible I have to set "permission to download" to yes. Which is strange. It is possible to work around, but not how it should be, I think. But it's yours to decide of course.
 
Top Bottom