Giter Club home page Giter Club logo

Comments (7)

burzum avatar burzum commented on September 26, 2024

Could you please properly report how to reproduce the issue and post the whole stack trace from the error? Also what branch or version are you using?

from cakephp-user-tools.

eymen-elkum avatar eymen-elkum commented on September 26, 2024

I resolved the problem as the following:

    public function register($options = []) {
        $options = Hash::merge($this->_config['registration'], $options);
        if ($options['enabled'] === false) {
            throw new NotFoundException();
        }
        $entity = $this->UserTable->newEntity();

        $return = false;                 // make return as a variable

        // Make the field accessible in the case the default entity class is used.
        $entity->accessible('confirm_password', true);
        if ($this->request->is('post')) {
            $entity = $this->UserTable->patchEntity($entity, $this->request->data());
            if ($this->UserTable->register($entity)) {
                $this->handleFlashAndRedirect('success', $options);
                if ($options['setEntity'] === true) {
                    $this->_controller->set('usersEntity', $entity);
                }

                $return = true;    //dont return here, just set the value to true

            } else {
                $this->handleFlashAndRedirect('error', $options);
                if ($options['setEntity'] === true) {
                    $this->_controller->set('usersEntity', $entity);
                }
            }
        }
        //this line will executed in all cases, no return before.
        if ($options['setEntity'] === true) {
            $this->_controller->set('userEntity', $entity);
            // BC
            $this->_controller->set('usersEntity', $entity);
        }

        //the return comes here
        return $return;
    }

I hope the issue is clear now, and sorry if my English is not very well :)

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

Can you please show the change as diff or create a pull request?

There is no "userData" at all in the component by the way.

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

Fixed in the develop branch.

from cakephp-user-tools.

eymen-elkum avatar eymen-elkum commented on September 26, 2024

thanks

from cakephp-user-tools.

eymen-elkum avatar eymen-elkum commented on September 26, 2024

Sorry for my out of box question, but how can I use the develop branch?
I tried several times but didn't succeed

from cakephp-user-tools.

burzum avatar burzum commented on September 26, 2024

I urgently recommend you to read the composer manual. https://getcomposer.org/doc/ Composer is a common tool these days and Cake and almost all plugins and other popular php scripts use it.

composer require burzum/cakephp-user-tools dev-develop

But I've merged it into master as well and tagged 1.0.1 too.

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.