Tuesday, May 10, 2016

Final countdown to CakeFest  - Have you booked your spot?

Last week CakeFest 2016 Tickets are on Sale !!
View this email in your browser

Final call for tickets! - Will we see you there?

Ticket sales will be closing on Sunday 15th May - So if you have not bought yours yet, make sure you hurry! (If you experience any problems in the purchase process, please feel free to email me directly!)

We are really excited about this year's CakeFest Amsterdam! - We have some major announcements that will be revealed to those there!

With space limited, the workshop is filling up fast! - If you are looking for an interactive, up-to-date CakePHP 3 session, then these two days (26th and 27th May) are for you!

A big THANK YOU to our sponsors for their continual support! 
                 
                       
                         
We hope to see you there this year!

Megan
CakePHP Community manager

Better hurry though - with limited space this year (and tickets selling quickly)..

And just remember, Life's sweeter with a little Cake(Fest)

Haven't seen the speaker list or the schedule - Quick, check it out here!
© Copyright 2005-2016 Cake Software Foundation, Inc. All rights reserved


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list
 

Tuesday, May 3, 2016

Re: CakePHP 1.3.8 - Editing user info causes 404

Hi Reuben,

Thanks for your quick response yesterday. The URL I am getting is with the user ID.

For example: 
When I am logged in as an administrator and go view all users (/admin/admin/view_all_users) and I click to edit user ID="305880" (/admin/admin/user_edit/305880), after making changes to the form I click save (Enregistrer) and the URL I come back to is the same (/admin/admin/user_edit/305880) but displays a 404 page. I can then copy the URL into another tab and the page loads (without any changes saved).

So I've been digging through the CakePHP files for the past couple days and I must say it's a bit overwhelming with what seems like duplicate files/functions in similar filenames with a Postfix of "_bu" (maybe because of the way the original developer built it).

Anyways, what I found is the following, please let me know if I am even looking in the right spot...
So as I posted yesterday, the form is in app/views/admin/admin_user_edit.php
<?php echo $this->Form->create("User", array("url" => array("controller" => "admin", "action" => $this->params["action"]))); ?>
There are many fields > echo $this->Form->input("...");, etc...
<?php echo $this->Form->end("Enregistrer"); ?>

I did also find a function in app/controllers/admin_controller.php (I highlighted the redirect link for user_edit if user already exists)
function admin_user_edit($id = NULL){
$new_user = false;
if (!$id){
$new_user = true;
}
if (!empty($this->data)){
//print_r($this->data);
$this->_uz_remove_data_not_to_be_saved("UserAddress");
$this->_uz_remove_data_not_to_be_saved("UserPhone");
$this->_uz_remove_data_not_to_be_saved("UserEmail");
$this->_uz_remove_data_not_to_be_saved("UserLink");
$this->_uz_remove_data_not_to_be_saved("UserContact");
//print_r($this->data);
//special for new user
if ($new_user){
$this->User->save($this->data, array("validate" => false));
$id = $this->User->id;
$this->data['User']['user_id'] = $id;
}
//pr($this->data);
//validate password
if (!empty($this->data['User']['password']) && !empty($this->data['User']['confirm_password'])){
if ($this->data['User']['confirm_password'] == $this->data['User']['password']){
}
else {
unset($this->data['User']['password']);
unset($this->data['User']['confirm_password']);
}
}
else {
unset($this->data['User']['password']);
unset($this->data['User']['confirm_password']);
}
if (!empty($this->data['ExpertisesUser']['expertise_id'])){
$all_eus = $this->data['ExpertisesUser']['expertise_id'];
unset($this->data['ExpertisesUser']);
foreach ($all_eus as $k => $v){
unset($temp);
$temp['user_id'] = $this->data['User']['user_id'];
$temp['expertise_id'] = $v;
$this->data['ExpertisesUser'][] = $temp;
}
}
else {
unset($this->data['ExpertisesUser']);
}
if (!empty($this->data['UserCircusField']['circus_field_id'])){
$all_eus = $this->data['UserCircusField']['circus_field_id'];
unset($this->data['UserCircusField']);
foreach ($all_eus as $k => $v){
unset($temp);
$temp['user_id'] = $this->data['User']['user_id'];
$temp['circus_field_id'] = $v;
$this->data['UserCircusField'][] = $temp;
}
}
else {
unset($this->data['UserCircusField']);
}
//delete previous circus fields and expertises first
if (!$new_user){
$this->loadModel("UserCircusField");
$this->loadModel("ExpertisesUser");
$this->UserCircusField->deleteAll(array("UserCircusField.user_id" => $this->data['User']['user_id']), false);
$this->ExpertisesUser->deleteAll(array("ExpertisesUser.user_id" => $this->data['User']['user_id']), false);
}

$this->loadModel("UserProfile");
unset($this->UserProfile->validate);
if ($this->User->saveAll($this->data)){
if ($new_user){
$redirect = array("action" => "new_user_order_creation", $this->data['User']['user_id']);
}
else {
$redirect = array("action" => "user_edit", $this->data['User']['user_id']);
}
$this->Session->setFlash("Utilisateur enregistré !", "fs");
$this->redirect($redirect);
}
else {
if ($new_user){
$this->User->delete($this->data['User']['user_id']);
unset($this->data['User']['user_id']);
}
$this->Session->setFlash("Utilisateur non enregistré. Vérifiez les erreurs ci-dessous.", "fe");
}
}
else {
//new user/////////////
if ($new_user){
$this->loadModel("UserProfile");
$max_member_number_temp = $this->UserProfile->find('first', array("recursive" => -1, "order" => "UserProfile.member_number DESC", "limit" => 1));
$this->data['UserProfile']['member_number'] = $max_member_number_temp['UserProfile']['member_number'] + 1;
$this->data['UserProfile']['member_since'] = date("Y-m-d");
$this->data['UserProfile']['membership_expiry'] = date("Y-m-d", strtotime("+ 1 year"));
$this->set('crumb', array("Utilisateurs" => array("action" => "view_all_users"), "Nouvel utilisateur" => array()));
}
//edit user/////////////
else {
$this->data = $this->User->find('first', array('conditions' => array("User.user_id" => $id)));
$this->set('crumb', array("Utilisateurs" => array("action" => "view_all_users"), "# " . $id => array("action" => "user_edit11", $id)));
}
}
$this->_get_countries();
$this->_get_regions();
$this->_get_companies();
$this->_get_main_activity_fields();
$this->_get_expertises();
$this->_get_circus_fields();
$this->_get_membertypes();
}


If I am not in the right place, please let me know where I should be looking for the user_edit function. NOTE, the same issue happens for users (non admin) when they edit their profile or other info. Add works, edit does not... so I'm a little lost :)

Any help would be great. I will also post this thread to http://discourse.cakephp.org to see if anyone else there can lend a hand as well.

Thank you,
josh





On Monday, May 2, 2016 at 9:12:56 PM UTC-4, Reuben wrote:
Hi Josh

What URL is actually getting posted when the form is submitted?  

My only concern is that $this->params["action"] is not populated with the value you are expecting.  

I'm guessing that you are expecting the values of that variable to be either add, edit, create or update.  

What are the signatures of those methods in the controller?

Usually an add function will just be `function add()`, but an edit function might be `function edit($id)`, in which case, the POST will fail, because the action is not providing an id on the URL (i.e. /users/edit is requested instead of /users/edit/1).

And last but not least, it looks like these forums are being wound down. Head over to http://discourse.cakephp.org for CakePHP discussions. (but still reply to this topic, if you need to)

Regards
Reuben Helms

On Tuesday, 3 May 2016 07:42:07 UTC+10, Josh R wrote:
Hello Group,

I am new to this group and CakePHP.

I am dealing with a site that is build using CakePHP version 1.3.8. When adding a new user, everything works fine. When modifying a user (either through admin's account or through the user's account) the save function keeps the URL of the page (with client ID in url as it should) but the page doesn't add the updated data to the database, and gives a 404 page. When the URL is copied and entered again in browser the User's page appears, but like I mentioned no changes to the User's information was recorded. See the start and end of the form functions, there are a lot of fields in this form.

<?php echo $this->Form->create("User", array("url" => array("controller" => "admin", "action" => $this->params["action"]))); ?>
There are many fields > echo $this->Form->input("...");, etc...
<?php echo $this->Form->end("Enregistrer"); ?>

I was told that this form was working properly a couple months ago (I just recently have been looking into this issue), and then one day the saving of the form stopped.

Any help is greatly appreciated. I can also send snippets of code if need be.

Thank you in advance!
josh

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP Forum launched!

This forum should be closed and switched to read only.
The other one should now be the only one in use.

See the PRs to change the links on the CakePHP sites and documentation etc.
Mark


Am Dienstag, 3. Mai 2016 03:01:20 UTC+2 schrieb Reuben:
Maybe this post should get stickied / pinned, so people know all the action should now be at discourse.cakephp.org.

Regards
Reuben Helms

On Tuesday, 26 April 2016 03:02:49 UTC+10, Megan Lalk wrote:

CakePHP Forum launched!

We asked you what you wanted and the feedback was clear! Sign up here - http://discourse.cakephp.org/

As you know, a CakePHP forum is a welcomed platform by many! - From today, you  can be a part of the discussion and post your questions, find out the answers and make comments - all stored in one easy location!

Our Google group has been a great place for many developers over the years, but also comes with a few difficulties. Results from our poll came in, and the consensus was that we needed a place where we could ask our questions, find out what others were asking and seek the advise from others. This platform allows for better interaction with your community!

Well there you have it, besides our #CakePHP channel on IRCSlack channel, Stackoverflow and our community newsletter; You can now also find us on our new CakePHP Forum.


                                                                                                                      Larry E. Masters
                                                                                                                      Co-Founder CakePHP

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monday, May 2, 2016

Re: CakePHP 1.3.8 - Editing user info causes 404

Hi Josh

What URL is actually getting posted when the form is submitted?  

My only concern is that $this->params["action"] is not populated with the value you are expecting.  

I'm guessing that you are expecting the values of that variable to be either add, edit, create or update.  

What are the signatures of those methods in the controller?

Usually an add function will just be `function add()`, but an edit function might be `function edit($id)`, in which case, the POST will fail, because the action is not providing an id on the URL (i.e. /users/edit is requested instead of /users/edit/1).

And last but not least, it looks like these forums are being wound down. Head over to http://discourse.cakephp.org for CakePHP discussions. (but still reply to this topic, if you need to)

Regards
Reuben Helms

On Tuesday, 3 May 2016 07:42:07 UTC+10, Josh R wrote:
Hello Group,

I am new to this group and CakePHP.

I am dealing with a site that is build using CakePHP version 1.3.8. When adding a new user, everything works fine. When modifying a user (either through admin's account or through the user's account) the save function keeps the URL of the page (with client ID in url as it should) but the page doesn't add the updated data to the database, and gives a 404 page. When the URL is copied and entered again in browser the User's page appears, but like I mentioned no changes to the User's information was recorded. See the start and end of the form functions, there are a lot of fields in this form.

<?php echo $this->Form->create("User", array("url" => array("controller" => "admin", "action" => $this->params["action"]))); ?>
There are many fields > echo $this->Form->input("...");, etc...
<?php echo $this->Form->end("Enregistrer"); ?>

I was told that this form was working properly a couple months ago (I just recently have been looking into this issue), and then one day the saving of the form stopped.

Any help is greatly appreciated. I can also send snippets of code if need be.

Thank you in advance!
josh

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP Forum launched!

Maybe this post should get stickied / pinned, so people know all the action should now be at discourse.cakephp.org.

Regards
Reuben Helms

On Tuesday, 26 April 2016 03:02:49 UTC+10, Megan Lalk wrote:

CakePHP Forum launched!

We asked you what you wanted and the feedback was clear! Sign up here - http://discourse.cakephp.org/

As you know, a CakePHP forum is a welcomed platform by many! - From today, you  can be a part of the discussion and post your questions, find out the answers and make comments - all stored in one easy location!

Our Google group has been a great place for many developers over the years, but also comes with a few difficulties. Results from our poll came in, and the consensus was that we needed a place where we could ask our questions, find out what others were asking and seek the advise from others. This platform allows for better interaction with your community!

Well there you have it, besides our #CakePHP channel on IRCSlack channel, Stackoverflow and our community newsletter; You can now also find us on our new CakePHP Forum.


                                                                                                                      Larry E. Masters
                                                                                                                      Co-Founder CakePHP

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 1.3.8 - Editing user info causes 404

Do you have validation when adding a user?

If so, it's probably not adding on an update because it's checking for the validation.

Turn off validation on the update and see if it works.

i'm not sure the cake1.8 way, but it's something like

$this->MODEL->save($data, $params => array('validate'=>false));

On Mon, May 2, 2016 at 3:05 PM, Josh R <josh@jackmarketing.ca> wrote:
Hello Group,

I am new to this group and CakePHP.

I am dealing with a site that is build using CakePHP version 1.3.8. When adding a new user, everything works fine. When modifying a user (either through admin's account or through the user's account) the save function keeps the URL of the page (with client ID in url as it should) but the page doesn't add the updated data to the database, and gives a 404 page. When the URL is copied and entered again in browser the User's page appears, but like I mentioned no changes to the User's information was recorded. See the start and end of the form functions, there are a lot of fields in this form.

<?php echo $this->Form->create("User", array("url" => array("controller" => "admin", "action" => $this->params["action"]))); ?>
There are many fields > echo $this->Form->input("...");, etc...
<?php echo $this->Form->end("Enregistrer"); ?>

I was told that this form was working properly a couple months ago (I just recently have been looking into this issue), and then one day the saving of the form stopped.

Any help is greatly appreciated. I can also send snippets of code if need be.

Thank you in advance!
josh

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CakePHP 1.3.8 - Editing user info causes 404

Hello Group,

I am new to this group and CakePHP.

I am dealing with a site that is build using CakePHP version 1.3.8. When adding a new user, everything works fine. When modifying a user (either through admin's account or through the user's account) the save function keeps the URL of the page (with client ID in url as it should) but the page doesn't add the updated data to the database, and gives a 404 page. When the URL is copied and entered again in browser the User's page appears, but like I mentioned no changes to the User's information was recorded. See the start and end of the form functions, there are a lot of fields in this form.

<?php echo $this->Form->create("User", array("url" => array("controller" => "admin", "action" => $this->params["action"]))); ?>
There are many fields > echo $this->Form->input("...");, etc...
<?php echo $this->Form->end("Enregistrer"); ?>

I was told that this form was working properly a couple months ago (I just recently have been looking into this issue), and then one day the saving of the form stopped.

Any help is greatly appreciated. I can also send snippets of code if need be.

Thank you in advance!
josh

--
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup
 
We will soon be closing this Google Group. But don't worry, we have something better coming. Stay tuned for an updated from the CakePHP Team soon.
 
Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.