Re: Error saving i18n

2011-12-29 Thread Constantin.FF
also i use
$model-data[$model-alias]['title'] = $title;
to set the title field

On Dec 28, 8:39 pm, Constantin FF constantin...@gmail.com wrote:
 absolutely the same result after adding
         $model-set(array('title' = $title, 'body' = $title));
 at the end of beforeSave

-- 
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


Error saving i18n

2011-12-28 Thread Constantin.FF
I am using Behavior which beforeSave sets the title of the post. I am
using this for attachments to set title, slug, create thumbs and so
on ..

With the testing till now these are the results: Set title inside:
-Behavior beforeSave - does not save inside i18n table
-Model bofereSave - does not save inside i18n table
-Controller before $this-Attachment-save($this-data) - Working!

What are my options to use only a Behavior to set the title? I guess
that this error appears because storing entry inside i18n table
happens before setting the title in the Behavior. So first it tries to
save record inside i18n, but still there is no title and it does not
save anything. After that saving applying the Behavior, which sets the
title and saves the record in the 'attachments' table.

How to debug and see, what is the data before inserting in the model
and i18n tables? Any ideas for the error?

-- 
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: Error saving i18n

2011-12-28 Thread Tilen Majerle
how do you set data in the behavior ?

do you use $Model-set() or ?

--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/12/28 Constantin.FF constantin...@gmail.com

 I am using Behavior which beforeSave sets the title of the post. I am
 using this for attachments to set title, slug, create thumbs and so
 on ..

 With the testing till now these are the results: Set title inside:
 -Behavior beforeSave - does not save inside i18n table
 -Model bofereSave - does not save inside i18n table
 -Controller before $this-Attachment-save($this-data) - Working!

 What are my options to use only a Behavior to set the title? I guess
 that this error appears because storing entry inside i18n table
 happens before setting the title in the Behavior. So first it tries to
 save record inside i18n, but still there is no title and it does not
 save anything. After that saving applying the Behavior, which sets the
 title and saves the record in the 'attachments' table.

 How to debug and see, what is the data before inserting in the model
 and i18n tables? Any ideas for the error?

 --
 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: Error saving i18n

2011-12-28 Thread Constantin FF
var $model = null;

function setup($model, $config = array()){
$this-settings[$model-alias] = array_merge($this-_defaults, 
$config);
$this-model = $model;
}

do i have to add $Model-set() also
On Wed, Dec 28, 2011 at 1:31 PM, Tilen Majerle tilen.maje...@gmail.com wrote:
 how do you set data in the behavior ?

 do you use $Model-set() or ?

 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2011/12/28 Constantin.FF constantin...@gmail.com

 I am using Behavior which beforeSave sets the title of the post. I am
 using this for attachments to set title, slug, create thumbs and so
 on ..

 With the testing till now these are the results: Set title inside:
 -Behavior beforeSave - does not save inside i18n table
 -Model bofereSave - does not save inside i18n table
 -Controller before $this-Attachment-save($this-data) - Working!

 What are my options to use only a Behavior to set the title? I guess
 that this error appears because storing entry inside i18n table
 happens before setting the title in the Behavior. So first it tries to
 save record inside i18n, but still there is no title and it does not
 save anything. After that saving applying the Behavior, which sets the
 title and saves the record in the 'attachments' table.

 How to debug and see, what is the data before inserting in the model
 and i18n tables? Any ideas for the error?

 --
 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

-- 
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: Error saving i18n

2011-12-28 Thread Constantin FF
absolutely the same result after adding
$model-set(array('title' = $title, 'body' = $title));
at the end of beforeSave

-- 
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