Jump to:

1169 Posts in 2694 Topics by 411 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » $allowed_actions changes

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 853 Views
  • tv
    Avatar
    Community Member
    44 Posts

    $allowed_actions changes Link to this post

    I was using the 3.0 compatible version of the SecureFiles module. Once a folder in assets is marked as secure in the backend, the module adds a .htaccess file to the folder and sends any requests to that folder through main.php to detect member permissions. Everything was working fine on 3.0.4 with the following director rules:

    Director:
    rules:
    'assets/$Action': 'SecureFileController'

    I am upgrading to 3.1 now and when I attempt to view a file located in a folder marked as secure ( for example: http://mysite.com/mypage/assets/Secure/securefile.m4a), I get the following error:

    Action 'securefile' isn't available on class SecureFileController

    Do I need to change my route configuration or does this have anything to do with the changes to $allowed_actions in 3.1?

    Thanks for any help.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: $allowed_actions changes Link to this post

    You probably just need to take off the $Action - 'assets': 'SecureFileController' as I assume everything would just go through the 1 action?

  • elgordo
    Avatar
    Community Member
    70 Posts

    Re: $allowed_actions changes Link to this post

    There is a 3.1 compatible branch of secure files here, https://github.com/timsnadden/silverstripe-securefiles/tree/3.1 - however it suffers from the same issue as previously mentioned regarding the foldername being mistaken for an action.

    1) What are the best ways to debug routing issues?
    2) Is there any way in routes.yml or indeed the controller to wipe and previous routing rules and start afresh.

    Cheers

    Gordon

    853 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.