Code Monkey home page Code Monkey logo

Comments (18)

webforge avatar webforge commented on September 25, 2024

The 'Sign Up' link goes to 'user/create' on a recently cloned install - perhaps this was fixed since you cloned the repo...

The 'Missing argument 1 for UserController::postIndex()' still happens though when signing up. In app/controllers/user/UserController.php, the postIndex() method expects $user as a parameter. It looks like it was done this way to allow a user to 'Edit your settings' ( /user ) where a user can update their settings.** Here it makes sense to pass in a user object to update.

However, when signing up, no user exists yet and a user object can not be passed in to the method - hence the error. The fix involves changing lines 24, 25 of app/controllers/user/UserController from:

public function postIndex($user)
    {

to:

public function postIndex($user=null)
    {
        $user = ($user == null ? new User() : $user);

Hope that helps :)

**As a side issue, there is no link to 'Edit your settings' for a user who is logged in. Clicking on 'Logged in as username' in the nav bar brings the user to /user/settings which just displays user settings but doesn't allow them to be edited...

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

Yeah I am working on a fix for that now

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

http://example.org/user/create Works as it should for me. What create account link goes to /user?

from laravel-4-bootstrap-starter-site.

christoferd avatar christoferd commented on September 25, 2024

Hi Andrew, I just did a fresh install and the big blue button [Create new
account] on this page /user/create, still goes to /user and shows an error.

Want me to try fix and push the update?

Cheers,

Chris De David

On 11 May 2013 05:03, Andrew [email protected] wrote:

http://example.org/user/create Works as it should for me. What create
account link goes to /user?


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-17738615
.

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

The create form should post to user
The edit user page should post to user/{id}/edit

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

and sure if you have a fix I'd be welcome to see it :)

On Sun, May 12, 2013 at 10:54 PM, Chris De David
[email protected]:

Hi Andrew, I just did a fresh install and the big blue button [Create new
account] on this page /user/create, still goes to /user and shows an
error.

Want me to try fix and push the update?

Cheers,

Chris De David
Phone: +61 (0) 3 5294 0297 | Mobile: +61 (0) 419 571 596 | Skype:
chris.dedavid
Mindflow.com.au

On 11 May 2013 05:03, Andrew [email protected] wrote:

http://example.org/user/create Works as it should for me. What create
account link goes to /user?


Reply to this email directly or view it on GitHub<
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/issues/65#issuecomment-17738615>

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-17793887
.

from laravel-4-bootstrap-starter-site.

christoferd avatar christoferd commented on September 25, 2024

Removed; github not liking email replies from gmail. Format is compressed :-/

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

Yeah that's a mistake. Should be something more like: 1565da0

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

Fixing the other piece 19684e3

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

I'll be merging that branch in shortly

from laravel-4-bootstrap-starter-site.

christoferd avatar christoferd commented on September 25, 2024

Andrew,

This fixed the issue: I removed the requirement of ($user) as a parameter.
Then created User object manually.

What happens then, it jumps to the login page, without any messages to say
that it worked or didn't work. I'll be updating that later.
It also sends an email, so I know it worked. Confirming the email and login
works from there.

Added some validation stuff,... trying to get messages back to form.

Code with Validation

    /**
     * Stores new user
     *
     */
    public function postIndex()
    {
        // Validate
        $rules = array(
            'username' => array('required', 'min:5'),
            'email' => array('email', 'min:5'),
            'password' => array('required', 'min:5'),
            'password_confirmation' => array('same:password', 'min:5'),
            );

        $validator = Validator::make(Input::all(), $rules);

        if ($validator->fails())
        {
            return Redirect::to('user/create')
                ->withInput(Input::except('password'))
                ->withErrors($validator);
        }

        $user = new User();

This also means I'm updating the signup.blade.php to show validation
messages. I've sent you this in github too : )

Cheers,
Chris

from laravel-4-bootstrap-starter-site.

richlove1 avatar richlove1 commented on September 25, 2024

I think this relates to this issue also #63

from laravel-4-bootstrap-starter-site.

richlove1 avatar richlove1 commented on September 25, 2024

postIndex() and postEdit() are so similar, do you think there's a way we can keep them combined. I know there's the issue of $user parameter but something like the fix webforge suggested might be nice:

public function postIndex($user=null)
{
$user = ($user == null ? new User() : $user);

(Apologies if you're working on this)

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

:) yep!

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

Should be fixed now

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

Can't really combine, what they do is different.

from laravel-4-bootstrap-starter-site.

richlove1 avatar richlove1 commented on September 25, 2024

Yeah, that's fair enough

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 25, 2024

I would agree they are quite similar but they are just enough different to make combining difficult.

from laravel-4-bootstrap-starter-site.

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.