I have a registration form that a user can access via invitation. For example, an invited user can go to `/users/register/[invite_code]` and get a registration form that is partially populated. I'm seeing something I didn't expect:

If the invite code is valid, we return the user structure and set that in `$this->data` so that the form is automagically pre-populated. The pre-population works, but when the form loads, the data validation errors are displayed as though I'd submitted the form. I see a lot of "[Field name] cannot be empty" when a value has been pre-populated.

In response to questions, the register action is called to both display and submit the form. The code looks like this:

```
public function register( $invite = null ) {
  # Handle a submitted registration
  if( !empty( $this->data ) ) {
    # Do stuff...

    if( $this->User->save( $this->data ) ) {
      $this->Session->setFlash( 'Welcome. Thanks for registering.', null, null, 'success' );
      $this->redirect( $this->Auth->redirect() );
    }
    else {
      $this->Session->setFlash( 'Oh noz. There\'s a problem with your registration.', null, null, 'validation' );
    }
  }

  # If an invite is passed, pull the user attached to that invite.
  if( !empty( $invite ) ) {
    # Attempt to pull the user that owns the invite

    if( empty( $user ) ) { # Unrecognized invite code
      # Do stuff...
    }
    else { # Invited user found
      if( !empty( $user['User']['password'] ) ) { # Invited user has already registered
        # Do stuff...
      }
      else { # This is the invited user
        $this->data = $user;
      }
    }
  }
}

```

Thanks.

**UPDATE**

After coming back to this, the problem comes when I assign the user to `$this->data`. When I remove that, no validation errors. Unfortunately, no pre-population either. I need the latter, so I need to find a way of setting the data points without triggering the error messages.

**UPDATE 2**

If I dump `$this->User->invalidFields()`, even as early as the first line of `UsersController::beforeFilter()`, the array is populated with invalids. How is this possible? What could I possibly be doing that early in the request to cause this?

**UPDATE 3**

I've also noticed that as I enter `UsersController::beforeFilter()`, the value of `$this->User->id` is already set. I have no idea where or why, but this seems significant. As far as I know, the first step into the actual application code is the relevant controller's `beforeFilter` method and the user id is set on the way in.