Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6763657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:30:09+00:00 2026-05-26T14:30:09+00:00

I’m having a spot of problem with CakePHP 2.0.2. I’m wanting to create an

  • 0

I’m having a spot of problem with CakePHP 2.0.2. I’m wanting to create an “edit profile” action. Here’s my controller action:

public function edit_profile() {
    if ($this->request->is('get')) {
        $this->request->data = $this->User->findById($this->Auth->user('id'));
    } else {
        if ($this->User->save($this->request->data)) {
            $this->Session->setFlash(__('Your profile has been updated'));
        }
    }
}

And here’s my view:

<h2>Edit Profile</h2>
<?php
    echo $this->Form->create('User');
    echo $this->Form->input('id', array('type' => 'hidden'));
    echo $this->Form->input('first_name');
    echo $this->Form->input('last_name');
    echo $this->Form->input('email');
    echo $this->Form->end('Save Profile');
?>

However, when I submit the form, nothing seems to happen. I get no success message, and I also get no error message. If I put an else statement to complement if ($this->User->save($this->request->data)), that code block is executed though, indicating the User model data is not saved.

Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:30:10+00:00Added an answer on May 26, 2026 at 2:30 pm

    Check $this->User->validationErrors in the else statement if the user is not saved. My bet is that you have extra validation rules defined that are failing for fields not in your form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem I'm having is that any 'delete' action that gets called in IE-7
I'm following this tutorial Drag Drop Inventory in Jquery and i'm having a problem.
We're having a spot of a problem with the FragmentViewPager and Fragments. We are
I'm having a spot of bother getting anything to log with FirePHP and Zend
I am having some trouble creating a nested association and I can't quite spot
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having a problem getting a TreeView control to display node images. The code below
Having programmed through emacs and vi for years and years at this point, I
I'm having a spot of trouble in making my functions work and my book
This is weird ... done updates loads of times before but cannot spot why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.