Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AclExtras::_checkMethods() Exception if it faces abstract controller #40

Closed
sarrala opened this issue Jan 29, 2015 · 2 comments
Closed

Comments

@sarrala
Copy link
Contributor

sarrala commented Jan 29, 2015

cake acl.aclExtras aco_update

Created Aco node: controllers/Base
PHP Fatal error:  Cannot instantiate abstract class App\Controller\BaseController in vendor/cakephp/acl/src/AclExtras.php on line 297

This came into my mind about fixing this issue, btw should I just make PR's straight away for this kind of stuff?

Change line AclExtras.php : 297:

    protected function _checkMethods($className, $controllerName, $node, $pluginPath = false)
...
        $actions = get_class_methods(new $namespace);
...

To:

    protected function _checkMethods($className, $controllerName, $node, $pluginPath = false)
...
        $reflectionClass = new \ReflectionClass( $namespace );
        $actions = null;
        if ($reflectionClass->IsInstantiable()) {
            $actions = get_class_methods(new $namespace);
        }
...
@rchavik
Copy link
Member

rchavik commented Jan 29, 2015

Yes, please do.

Note: There's a similar fix on _getCallbacks(): cb46897

sarrala added a commit to sarrala/acl that referenced this issue Jan 29, 2015
Issue: AclExtras::_checkMethods() Exception if it faces abstract controller cakephp#40
@sarrala
Copy link
Contributor Author

sarrala commented Jan 29, 2015

PR created: Fix _checkMethods() for abstract controllers #41

@sarrala sarrala closed this as completed Jan 29, 2015
rchavik pushed a commit that referenced this issue Jun 2, 2015
Issue: AclExtras::_checkMethods() Exception if it faces abstract controller #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants