Giter Club home page Giter Club logo

Comments (13)

burzum avatar burzum commented on September 26, 2024

I think there has been a change in the dispatcher of the CakePHP framework itself. What version are you using?

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

3.1.7

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

So just changing all the methods from underscored to camelCased in the components map fixes the problem for you? I couldn't find anything related to that in the 3.1 changelog and I have three apps using that version without that I've noticed trouble.

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

Inside the UserToolComponent

'actionMap' => [
            'index' => [
                'method' => 'listing',
                'view' => 'Burzum/UserTools.UserTools/index',
            ],
            'register' => [
                'method' => 'register',
                'view' => 'Burzum/UserTools.UserTools/register'
            ],
            'login' => [
                'method' => 'login',
                'view' => 'Burzum/UserTools.UserTools/login',
            ],
            'logout' => [
                'method' => 'logout',
                'view' => null
            ],
            'resetPassword' => [
                'method' => 'resetPassword',
                'view' => 'Burzum/UserTools.UserTools/reset_password',
            ],
            'requestPassword' => [
                'method' => 'requestPassword',
                'view' => 'Burzum/UserTools.UserTools/request_password',
            ],
            'changePassword' => [
                'method' => 'changePassword',
                'view' => 'Burzum/UserTools.UserTools/change_password',
            ],
            'verifyEmail' => [
                'method' => 'verifyEmailToken',
                'view' => 'Burzum/UserTools.UserTools/verify_email',
            ],
            'view' => [
                'method' => 'getUser',
                'view' => 'Burzum/UserTools.UserTools/view',
            ]
        ]

in my boostrap

Configure::write('UserTools.Component', [
    'actionMap' => [
        'index' => [
            'method' => 'listing',
            'view' => 'UserTools.UserTools/index',
        ],
        'register' => [
            'method' => 'register',
            'view' => 'register'
        ],
        'changePassword' => [
            'method' => 'changePassword',
            'view' => 'change_password'
        ],
        'login' => [
            'method' => 'login',
            'view' => 'login',
        ],
        'logout' => [
            'method' => 'logout',
            'view' => null
        ],
    ],
]);

that's how it works for me, I tried to access it like request-password or request_password but the $action in

public function mapAction() {
        $action = $this->request->params['action'];

was always returning it camelBacked. When I changed it worked.

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

isn't it part of the new conventions to have actions camelBacked ?

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

I'm pretty sure it is because of PSR. I just can't see where I have missed that change to the CakePHP core. I've checked the release notes but haven't seen it there. With 3.0 it was working the way it is. I fear there is a difference between old and new apps. So the difference might be in the cakephp/app package, loading another dispatcher filter or something like that.

https://github.com/cakephp/app/releases

3.1.0-beta …
CakePHP App Skeleton 3.1.0-beta
* Default to DashedRoute.

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

@djonatanb please see

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

Not sure if I understand it all, but for me the problem seemed to be the action name. As far as I understand you are using action names with underscore as the key in the config array.

Are you using dashedRoute in the projects with cakephp3.0 that work ok with the underscore actions ?

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

@djonatanb no need to understand it, I've fixed it in a backward compatible way. Would you please mind switching to the develop branch of the plugin for a moment? It's fixed there. After your feedback I'll tag version 1.0.3.

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

ok, gotcha, will do that

from cakephp-user-tools.

djonatanb avatar djonatanb commented on September 26, 2024

The routing is working for me now. Thanks, I'll see if I can implement the user registration by invitation and make a pull request at some point.

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

A PR for what? If you want an user registration you can re-use the token mechanism. Just trigger the email with the verification token when the admin creates the user and disable the user registration.

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

I've merged to master and tagged 1.0.3 Thank you.

from cakephp-user-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.