Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorpogeybait4883
    I have a controller that I am trying to use a beforeFilter on.
    My controller has the following methods: __construct(), approve(), deny(), destroy(), listing(), flag(), _getComment(), and _getSubmissions().

    Here is my __construct() method:

    function __construct() {
    $this->beforeFilter( '_getComment' );
    $this->beforeFilter( '_getSubmissions');
    $this->beforeFilter( array( '_requireContestOwner' => array( 'except' => array ('flag') ) ) );

    In theory the third beforeFilter is supposed to apply the method _requireContestOwner() to all methods EXCEPT for the flag() method but when I load the listing() method in my browser the before filter doesn't apply.

    However if I do this:
    $this->beforeFilter( array( '_requireContestOwner' => array( 'only' => array ('listing') ) ) );
    then it works.

    Can anyone find fault with anything that I'm doing? I have tried:
    $this->beforeFilter( array( '_requireContestOwner' => array( 'except' => 'flag') ) );
    but it yields the same result.

    Any help would be appreciated. Thanks.
    • CommentAuthorpogeybait4883
    After more testing it appears there may be an issue with using 'except'. The following code seems to work fine:

    $this->beforeFilter( array( '_requireContestOwner' => array( 'only' => array ('listing', 'approve','deny','destroy') ) ) );

    whereas this does not:

    $this->beforeFilter( array( '_requireContestOwner' => array( 'except' => array ('flag') ) ) );

    Any ideas?
    • CommentAuthoroisucf
    I'm running into the same issue. Is this a bug??