XF 2.0 How to turn off the URL checks in resources?

sub_ubi

Well-known member
edit: nvm figured it out. /src/addons/XFRM/Service/ResourceItem/Edit.php

Comment out: $this->resource->error(\XF::phrase('please_enter_valid_url'),'download_url');



I'm letting my users edit each other's resources, but I'm trying to hide the "download URL" input box when editing a resource that isn't theirs:

Bold is my change to the template, xfrm_resource_edit
Rich (BB code):
          <xf:elseif is="$resource.isExternalDownload() && ($xf.visitor.is_admin OR ($xf.visitor.user_id == $resource.user_id))" />
                <xf:textboxrow name="external_download_url" value="{$resource.CurrentVersion.download_url}"
                    label="{{ phrase('xfrm_external_download_url') }}" />
            </xf:if>

This seems to work when editing, but when a user who cannot see the URL box attempts to save the resource, they get this error:
"please enter a valid URL"

190780
 
Last edited:
Top Bottom