Unable to set parent_id = id in add or edit actions in self assoc model

2013-03-21 Thread mk
Hi
I posted a question on stack overflow that I was hoping someone here could 
help me figure out. (should have probably posted here first...). Anyway I 
am having some issues trying to save (both add  edit) into a parent_id 
column in a Model that I have setup as a self association.

Basically I would like some items to be their own parent by setting 
parent_id = id. However when I try to do this in the add action it is not 
saving anything (I use getInsertId() to obtain the ID that was just created 
and then try to use saveField() to save that into my parent_id. Not 
working. I then have tried using the edit action/view and setting an item 
so it is it's own parent, but it doesn't save from there either... any help 
is greatly appreciated.

Obviously I am still learning but feel this isn't too uncommon of a 
behavior and can be handled in cakephp (probably rather easily.)

http://stackoverflow.com/questions/15538838/cakephp-save-newly-created-id-in-parent-id-field-of-self-assoc-model

Just to summarize my code

Model Self Associations - Item.php

class Item extends AppModel {
public $actsAs = array('Tree');

/* Validation rules temporarily removed */

public $belongsTo = array(
'ParentItem' = array(
'className' = 'Item',
'foreignKey' = 'parent_id',
'conditions' = '',
'fields' = '',
'order' = ''
)),
public $hasMany = array(
'ChildItem' = array(
'className' = 'Item',
'foreignKey' = 'parent_id',
'conditions' = '',
'fields' = '',
))

Controller Add Action:

public function add() {
if ($this-request-is('post')) {
$this-Item-create();
unset($this-request-data['Item']['parent_id']);
if ($this-Item-save($this-request-data)) {
$last_id = $this-Item-getInsertId();
$this-Item-saveField('parent_id', $last_id);
$this-Session-setFlash(__('The item has been saved'));
$this-redirect(array('action' = 'index'));
} else {
$this-Session-setFlash(__('The item could not be saved. 
Please, try again.'));
}
}



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find 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+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Self Association parent_id doesn't display in view drop down

2013-03-20 Thread mk
perfect... thanks. I knew it would be something simple after spending too 
many hours trying everything but that, 

On Wednesday, March 20, 2013 2:24:07 AM UTC-5, AD7six wrote:

 $parentItems - $parents

 AD

 On Wednesday, 20 March 2013 03:28:09 UTC+1, mk wrote:

 Hi

 I am having some trouble getting a self association parent_id to show up 
 in the scaffolding drop down list of a view. 

 I have the following baked add action in my controller
 public function add() {
 if ($this-request-is('post')) {
 $this-Item-create();
 if ($this-Item-save($this-request-data)) {
 $this-Session-setFlash(__('The item has been saved'));
 $this-redirect(array('action' = 'index'));
 } else {
 $this-Session-setFlash(__('The item could not be saved. 
 Please, try again.'));
 }
 }
 $parentItems = $this-Item-ParentItem-find('list');
 $collections = $this-Item-Collection-find('list');
 $this-set(compact('parentItems', 'collections'));
 }

 This passes parentItems and collections to my view (add.ctp) but the view 
 outputs an empty dropdown box for parent_id

 fieldset
 legend?php echo __('Add Item'); ?/legend
 ?php
 echo $this-Form-input('parent_id');
 echo $this-Form-input('collection_id');
 echo $this-Form-input('name');
 ?
 /fieldset

 Does anyone have an idea what I am doing wrong? I have the following 
 associations setup in my model
 Item Model/Item.php - contains columns id, parent_id, lft, rght  name
 
 public $belongsTo = array(
 'ParentItem' = array(
 'className' = 'Item',
 'foreignKey' = 'parent_id',
 'conditions' = '',
 'fields' = '',
 'order' = ''
 ),

 public $hasMany = array(
 'ChildItem' = array(
 'className' = 'Item',
 'foreignKey' = 'parent_id',
 'dependent' = false,
 'conditions' = '',
 'fields' = '',
 'order' = '',
 ),

 I also see the parentItems array in the variables of the debug toolkit so 
 I know they are there... just need to know how to show the name for each 
 parent_id

 Thanks in advance for any help.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find 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+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Self Association parent_id doesn't display in view drop down

2013-03-19 Thread mk
Hi

I am having some trouble getting a self association parent_id to show up in 
the scaffolding drop down list of a view. 

I have the following baked add action in my controller
public function add() {
if ($this-request-is('post')) {
$this-Item-create();
if ($this-Item-save($this-request-data)) {
$this-Session-setFlash(__('The item has been saved'));
$this-redirect(array('action' = 'index'));
} else {
$this-Session-setFlash(__('The item could not be saved. 
Please, try again.'));
}
}
$parentItems = $this-Item-ParentItem-find('list');
$collections = $this-Item-Collection-find('list');
$this-set(compact('parentItems', 'collections'));
}

This passes parentItems and collections to my view (add.ctp) but the view 
outputs an empty dropdown box for parent_id

fieldset
legend?php echo __('Add Item'); ?/legend
?php
echo $this-Form-input('parent_id');
echo $this-Form-input('collection_id');
echo $this-Form-input('name');
?
/fieldset

Does anyone have an idea what I am doing wrong? I have the following 
associations setup in my model
Item Model/Item.php - contains columns id, parent_id, lft, rght  name

public $belongsTo = array(
'ParentItem' = array(
'className' = 'Item',
'foreignKey' = 'parent_id',
'conditions' = '',
'fields' = '',
'order' = ''
),

public $hasMany = array(
'ChildItem' = array(
'className' = 'Item',
'foreignKey' = 'parent_id',
'dependent' = false,
'conditions' = '',
'fields' = '',
'order' = '',
),

I also see the parentItems array in the variables of the debug toolkit so I 
know they are there... just need to know how to show the name for each 
parent_id

Thanks in advance for any help.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find 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+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Extending Plugin Question - location of new controllers/models/views

2013-01-10 Thread mk
 

Hi 

I’m using the cakedc users plugin in my app and have it working well. I’d 
like to extend it now and I have read through the readme “How to extend the 
plugin” https://github.com/CakeDC/users#how-to-extend-the-plugin, where 
they give example controller called AppUsersController and model called 
AppUser.

App::uses('UsersController', 'Users.Controller');

class AppUsersController extends UsersController {

public function beforeFilter() {

parent::beforeFilter();

$this-User = ClassRegistry::init('AppUser');

}

}

App::uses('User', 'Users.Model');
 class AppUser extends User {
   public $useTable = 'users';
 }

My question is where do you place this controller/model/view files? Do you 
extend a plugin and place them the main app folders or the plugin folders?

/myapp/Controller/AppUsersController.php

Or

/myapp/Plugin/users/Controller/AppUsersController.php

I have tried both and it works in the /plugin/ folder but I just want to 
make sure that is correct. 

Thanks in advance 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Displayfield from plugin not used from main app

2013-01-04 Thread mk
I found my issue. What I meant was I was trying to get the 'username' to 
show up in a view that is not a view from the actual plugin.

My mistake was simple, In my hasmany model relationship, I didn't have 
correct 'className', just had the controller name 'User' but was missing 
the reference to the plugin. 

Incorrectly had this:
public $belongsTo = array(
'User' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
Needed this:
public $belongsTo = array(
'User' = array(
'className' = 'Users.User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
'order' = ''
)

Thanks again for your help.

On Thursday, January 3, 2013 8:58:34 PM UTC-6, cricket wrote:

 Not sure what you mean by that. Have you tried debug($data) to see 
 what's in the array? 

 On Thu, Jan 3, 2013 at 7:22 PM, mk mkla...@gmail.com javascript: 
 wrote: 
  Thanks for quick reply. I will take another look at the plugin views, 
 but I 
  am not sure that is where I need to change things. 
  
  I'm calling the user_id hoping to get the displayField from outside of 
 the 
  plugin from a view from my main app. 
  
  
  
  On Thursday, January 3, 2013 5:22:34 PM UTC-6, cricket wrote: 
  
  On Thu, Jan 3, 2013 at 5:14 PM, mk mkla...@gmail.com wrote: 
   Hi, 
   
   I'm using the CakeDC Users plugin and have it working, however when I 
   access 
   it from a View in the main app, it is showing only the user id rather 
   than 
   the displayfield = 
   'username'; 
   
   Plugin User Model contains 
   public $displayField = 'username'; 
  
  Does your users table have a 'username' column? 
  
   Main App View (add.ctp) Contains 
   echo $this-Form-input('user_id'); 
  
  That looks a little odd. I would expect that the id would be 
  auto-generated and that, minimally, there would be a username input. 
  
  I haven't used this plugin, btw. 
  
  ok, I've just looked at the schema for this. The user_id column is in 
  the user_details table. It's the foreign key pointing to the users 
  table. 
  
  Take a look at the views that come with the plugin. I think that 
  perhaps you've tried modifying things and taken a wrong turn 
  somewhere. 
  
   View displays user_id rather than username. 
   
   Any ideas on what needs to be done to get this to show displayfield 
   correctly? I tried adding a recursive=2 to the add action for the 
   correspoiding view but that did not work... 
  
  Changing recursive would have no effect. 
  
  -- 
  Like Us on FaceBook https://www.facebook.com/CakePHP 
  Find us on Twitter http://twitter.com/CakePHP 
  
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
  cake-php+u...@googlegroups.com javascript:. 
  Visit this group at http://groups.google.com/group/cake-php?hl=en. 
  
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Displayfield from plugin not used from main app

2013-01-03 Thread mk
Hi,

I'm using the CakeDC Users plugin and have it working, however when I 
access it from a View in the main app, it is showing only the user id 
rather than the displayfield = 
'username';

Plugin User Model contains
public $displayField = 'username';

Main App View (add.ctp) Contains
echo $this-Form-input('user_id');

View displays user_id rather than username.

Any ideas on what needs to be done to get this to show displayfield 
correctly? I tried adding a recursive=2 to the add action for the 
correspoiding view but that did not work...

Thanks in advance

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Displayfield from plugin not used from main app

2013-01-03 Thread mk
Thanks for quick reply. I will take another look at the plugin views, but I 
am not sure that is where I need to change things. 

I'm calling the user_id hoping to get the displayField from outside of the 
plugin from a view from my main app. 



On Thursday, January 3, 2013 5:22:34 PM UTC-6, cricket wrote:

 On Thu, Jan 3, 2013 at 5:14 PM, mk mkla...@gmail.com javascript: 
 wrote: 
  Hi, 
  
  I'm using the CakeDC Users plugin and have it working, however when I 
 access 
  it from a View in the main app, it is showing only the user id rather 
 than 
  the displayfield = 
  'username'; 
  
  Plugin User Model contains 
  public $displayField = 'username'; 

 Does your users table have a 'username' column? 

  Main App View (add.ctp) Contains 
  echo $this-Form-input('user_id'); 

 That looks a little odd. I would expect that the id would be 
 auto-generated and that, minimally, there would be a username input. 

 I haven't used this plugin, btw. 

 ok, I've just looked at the schema for this. The user_id column is in 
 the user_details table. It's the foreign key pointing to the users 
 table. 

 Take a look at the views that come with the plugin. I think that 
 perhaps you've tried modifying things and taken a wrong turn 
 somewhere. 

  View displays user_id rather than username. 
  
  Any ideas on what needs to be done to get this to show displayfield 
  correctly? I tried adding a recursive=2 to the add action for the 
  correspoiding view but that did not work... 

 Changing recursive would have no effect. 


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakeDC User Plugin not sending verification email

2012-07-10 Thread mk
Just to close loop on this... This is resolved, I was not calling correct 
config from my email.php. once I added 

-config('smtp')

it worked...

Thanks again

On Monday, July 9, 2012 8:04:26 PM UTC-5, mk wrote:

 Thanks for the reply... I will review my email.php again and hope to find 
 my error.

 thanks again
 mk

 On Monday, July 9, 2012 6:25:48 PM UTC-5, sams wrote:

 Your email cfg is incorrect with your app - see Config/email.php

 - S
 On 9 Jul 2012 23:45, mk mklap...@gmail.com wrote:

 yes, sorry typo. it is configure::write in my code. The Error simply 
 states 
 Could not send email. 

 *Error: * An Internal Error Has Occurred.

 I'm running this from localhost and maybe my smtp setup?... although I 
 thought I had it setup correctly.

 Thanks
 On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/**users/tree/2.0https://github.com/CakeDC/users/tree/2.0)
   
 , I have installed all necessary 
  plugins and I’m able to get to registration form, yet when I register 
 I do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default “from” 
 email 
  setting in my bootstrap to Configure::wrote(‘App.**defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\**CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($**content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send(**$this); 
  
  
  
  if (!empty($this-_config['log'])**) { 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 323 → 
  UsersController-_**sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-**request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail(**$this-User-data); 
  
  $this-Session-setFlash(__d('**users', 'Your 
 account has been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\**Controller.php line 485 → 
  ReflectionMethod-invokeArgs(**UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 103 → 
  Controller-invokeAction(**CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 85 → 
  Dispatcher-_invoke(**UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(**CakeRequest, 

  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at 
  http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php
   

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this 
 group at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC User Plugin not sending verification email

2012-07-10 Thread mk


 Just to close loop on this... This is resolved, I was not calling correct 
 config from my email.php. once I added 

 -config('smtp')

 it worked...

 Thanks again

 On Monday, July 9, 2012 8:04:26 PM UTC-5, mk wrote:

 Thanks for the reply... I will review my email.php again and hope to find 
 my error.

 thanks again
 mk

 On Monday, July 9, 2012 6:25:48 PM UTC-5, sams wrote:

 Your email cfg is incorrect with your app - see Config/email.php

 - S
 On 9 Jul 2012 23:45, mk mklap...@gmail.com wrote:

 yes, sorry typo. it is configure::write in my code. The Error simply 
 states 
 Could not send email. 

 *Error: * An Internal Error Has Occurred.

 I'm running this from localhost and maybe my smtp setup?... although I 
 thought I had it setup correctly.

 Thanks
 On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/**users/tree/2.0https://github.com/CakeDC/users/tree/2.0)
   
 , I have installed all necessary 
  plugins and I’m able to get to registration form, yet when I 
 register I do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default 
 “from” email 
  setting in my bootstrap to Configure::wrote(‘App.**defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\**CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($**content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send(**$this); 
  
  
  
  if (!empty($this-_config['log'])**) { 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 323 → 
  UsersController-_**sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-**request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail(**$this-User-data); 
  
  $this-Session-setFlash(__d('**users', 'Your 
 account has been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\**Controller.php line 485 → 
  ReflectionMethod-invokeArgs(**UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 103 → 
  Controller-invokeAction(**CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 85 → 
  Dispatcher-_invoke(**UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(**CakeRequest, 

  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at 
  http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php
   

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this 
 group at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC User Plugin not sending verification email

2012-07-09 Thread mk
yes, sorry typo. it is configure::write in my code. The Error simply states 
Could not send email. 

*Error: * An Internal Error Has Occurred.

I'm running this from localhost and maybe my smtp setup?... although I 
thought I had it setup correctly.

Thanks
On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/users/tree/2.0) , I have installed all 
 necessary 
  plugins and I’m able to get to registration form, yet when I register I 
 do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default “from” 
 email 
  setting in my bootstrap to Configure::wrote(‘App.defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send($this); 
  
  
  
  if (!empty($this-_config['log'])) { 
  
  ·  APP\Plugin\users\Controller\UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\UsersController.php line 323 → 
  UsersController-_sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail($this-User-data); 
  
  $this-Session-setFlash(__d('users', 'Your account has 
 been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\Controller.php line 485 → 
  ReflectionMethod-invokeArgs(UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.php line 103 → 
  Controller-invokeAction(CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.php line 85 → 
  Dispatcher-_invoke(UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(CakeRequest, 
  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscr...@googlegroups.com For more options, visit this 
 group at 
  http://groups.google.com/group/cake-php 


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC User Plugin not sending verification email

2012-07-09 Thread mk
Thanks for the reply... I will review my email.php again and hope to find 
my error.

thanks again
mk

On Monday, July 9, 2012 6:25:48 PM UTC-5, sams wrote:

 Your email cfg is incorrect with your app - see Config/email.php

 - S
 On 9 Jul 2012 23:45, mk mklap...@gmail.com wrote:

 yes, sorry typo. it is configure::write in my code. The Error simply 
 states 
 Could not send email. 

 *Error: * An Internal Error Has Occurred.

 I'm running this from localhost and maybe my smtp setup?... although I 
 thought I had it setup correctly.

 Thanks
 On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/**users/tree/2.0https://github.com/CakeDC/users/tree/2.0)
   
 , I have installed all necessary 
  plugins and I’m able to get to registration form, yet when I register 
 I do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default “from” 
 email 
  setting in my bootstrap to Configure::wrote(‘App.**defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\**CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($**content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send(**$this); 
  
  
  
  if (!empty($this-_config['log'])**) { 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 323 → 
  UsersController-_**sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-**request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail(**$this-User-data); 
  
  $this-Session-setFlash(__d('**users', 'Your account 
 has been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\**Controller.php line 485 → 
  ReflectionMethod-invokeArgs(**UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 103 → 
  Controller-invokeAction(**CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 85 → 
  Dispatcher-_invoke(**UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(**CakeRequest, 

  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at 
  http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php
   

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Save then FindAll misses recently saved?

2007-01-24 Thread mk

My problem is pretty simple.  I add a new item to the database via the
model-save() method.  I then try to retrieve the full list of items
including the one that I just saved via model-findall() so I can make
an ajax update.

The first time I add something, the add is made in the database, but
the find all doesn't find what I just added.  If I add a second thing,
the update will have the thing that I just added but not the most
recent thing.

Is there some kind of lag in the model that will not immediately
retrieve something that was recently added?

Here's the cod in my controller in case that helps explain what is
going on:

   function add()
   {
  if (!empty($this-data))
  {
$this-cleanUpFields();

$this-data['Attribute']['attribute_type_id'] =
$this-RetrieveTypeID($this-data['Attribute']['attribute_type_id']);
$this-Attribute-save($this-data);  // - data gets saved
here
  }

  $this-AttributeType-recursive = 1;
  $this-set('types', $this-AttributeType-findAll());  // --
attempt to retrieve the full list including the thing that was just
saved here
  $this-render('list', 'ajax');
   }

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---