Re: uploading large file fails

2011-10-02 Thread Zaky Katalan-Ezra
http://www.sitepoint.com/upload-large-files-in-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


One core, multiple apps, shared classes

2011-10-02 Thread Ernesto
Hello.

i can't figure out how to configure a single cake core, multiple app 
enviroment in Cake 2.0.

i did it in 1.3 but it isn't working anymore.

is it still possible?

-- 
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: uploading large file fails

2011-10-02 Thread Phang Mulianto
for that size better using ftp. .better way to uploading..
 On Oct 1, 2011 1:14 AM, "Miles J"  wrote:
> Why are you even uploading a 58MB file?
>
> On Sep 29, 1:21 pm, aortizhi  wrote:
>> i already have changed to post_max_size=800M and upload_max_filesize =
>> 800M, and still don't work, am i doing something wrong?
>> On Sep 29, 3:06 pm, Ryan Schmidt  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > On Sep 29, 2011, at 15:01, aortizhi wrote:
>>
>> > > When i select a file that
>> > > is not that big, it uploads ok, but when i am trying to upload a file
>> > > that is at least 58 MB it fails uploading and the file won't be the
>> > > same at server side.
>>
>> >http://php.net/upload-max-filesize
>>
>> > The default max is 2MB in PHP 5.3.8.
>
> --
> 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


CakeFest 2011 videos

2011-10-02 Thread Larry E. Masters
I have started uploading videos from CakeFest 2011. Over the next few days I
will release more as I complete audio enhancements and editing of raw video.
Hope you enjoy, hope to see everyone at the next CakeFest you missed a great
time this year.

http://tv.cakephp.org/

http://tv.cakephp.org/playlists/view/CakeFoundation/cakefest_2011_talks_-_uk

-- 
Larry E. Masters

-- 
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: Fat Model Skinny Controlller? Is this really correct?

2011-10-02 Thread Jeremy Burns | Class Outfit
Right principle but not a good example as a component would handle your 
situation (arguably) better. Fat models are more about centralising business 
logic within the actual models and letting controllers control the flow of the 
application by calling the right bits of logic at the right time.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Oct 2011, at 17:05, Sam Sherlock wrote:

> Yep that's a summary of my thoughts on fat models.
> 
> I think a good example of this is cakedc users plugin - updated last night 
> along with a other cakedc plugins.
> 
> 
> - S
> 
> On 1 Oct 2011 14:46, "badben"  wrote:
> > I'm certainly no expert but my understanding is that the placing as much 
> > logic in the model as possible is the best way as many controllers can use 
> > the same model and often many controller methods save/edit/delete model 
> > data.
> > 
> > For example, if you want to store a serializaed array into the db, if the 
> > logic to serialize the array is placed into the controller you would have 
> > to 
> > serialize the value everywhere that the model is saved. If you have ten 
> > functions in the controller that save the model then you would have to 
> > repeat the code ten times.
> > 
> > However, if the code to serialize the array is placed in the model instead 
> > you only have to write the code once and can prety much forget about it 
> > from 
> > then on. Also when you come to refactor your code you only have to change 
> > the code in one place, not in every controller using the model
> > 
> > It adhears to the DRY (Don't Repeat Yourself) principle and will make your 
> > life easier and hopefully less buggy.
> > 
> > At least that is my understanding.
> > 
> > -- 
> > 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


history log table

2011-10-02 Thread elogic
My client wants a listing of all actions that happen within the system
so they can check back and search the records at a later date.

I thought the best way to handle this would be to have a histories
table which would be similar to below:

CREATE TABLE `histories` (
`id` INT(11) NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL DEFAULT '0',
`action` VARCHAR(50) NULL DEFAULT NULL,
`content` VARCHAR(250) NULL DEFAULT NULL,
`created` DATETIME NULL DEFAULT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
INDEX `user_id` (`user_id`)
)


How would I go about inserting the user_id (the logged user - using
Auth), action (i.e. create, edit, delete, login etc) and content
(added joe blogs or deleted record ID123 etc) from every section
within the site?

Thanks

-- 
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: CakePHP 2.0 Component Merging

2011-10-02 Thread Robert
Yep, I saw that. I have the Auth component defined in the components
array of my AppController. My UsersController inherits the
AppController, so shouldn't the components array from the
AppController be merged into the components array in the
UsersController?

On Oct 3, 12:07 am, Andras Kende  wrote:
> Try this:http://book.cakephp.org/2.0/en/controllers/components.html
>
> Andras
>
> On Oct 2, 2011, at 10:56 PM, Robert wrote:
>
>
>
>
>
>
>
> > Hey All,
>
> > Was there a change in the way that components are loaded up in
> > controllers? I looked at the source and didn't notice anything
> > different between 1.3 and 2.0 surrounding this.
>
> > I pasted my 1.3 source into a 2.0 directory structure and I'm in the
> > process of re-cake-ifying itand in my Users controller I have
> > $this->Auth->allow() being called in beforeFilter. With that, cake
> > complains "Fatal error: Call to a member function allow() on a non-
> > object" because the Auth component isn't loaded.
>
> > However, I have verified that it is loaded in AppController (the
> > parent controller), shouldn't the two components arrays be merged?
>
> > This works in 1.3, I literally did a copy and paste of the app code.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
> > athttp://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: CakePHP 2.0 Component Merging

2011-10-02 Thread Andras Kende
Try this: http://book.cakephp.org/2.0/en/controllers/components.html

Andras

On Oct 2, 2011, at 10:56 PM, Robert wrote:

> Hey All,
> 
> Was there a change in the way that components are loaded up in
> controllers? I looked at the source and didn't notice anything
> different between 1.3 and 2.0 surrounding this.
> 
> I pasted my 1.3 source into a 2.0 directory structure and I'm in the
> process of re-cake-ifying itand in my Users controller I have
> $this->Auth->allow() being called in beforeFilter. With that, cake
> complains "Fatal error: Call to a member function allow() on a non-
> object" because the Auth component isn't loaded.
> 
> However, I have verified that it is loaded in AppController (the
> parent controller), shouldn't the two components arrays be merged?
> 
> This works in 1.3, I literally did a copy and paste of the app code.
> 
> -- 
> 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


CakePHP 2.0 Component Merging

2011-10-02 Thread Robert
Hey All,

Was there a change in the way that components are loaded up in
controllers? I looked at the source and didn't notice anything
different between 1.3 and 2.0 surrounding this.

I pasted my 1.3 source into a 2.0 directory structure and I'm in the
process of re-cake-ifying itand in my Users controller I have
$this->Auth->allow() being called in beforeFilter. With that, cake
complains "Fatal error: Call to a member function allow() on a non-
object" because the Auth component isn't loaded.

However, I have verified that it is loaded in AppController (the
parent controller), shouldn't the two components arrays be merged?

This works in 1.3, I literally did a copy and paste of the app code.

-- 
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: model->delete() returns false but record gets deleted

2011-10-02 Thread Burningfuses
Hello again.
I just found out what the problem was.
I have a trigger in a table and the delete action was causing a recursion in 
my MySQL. Since I had debug set to 0, I wasn't able to see what the actual 
problem was.
The funny thing is that this trigger is working fine locally, but not on the 
server. But this is another matter :)

-- 
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: Cakephp Transaction

2011-10-02 Thread succer...@tiscali.it
ok i've partially solved the problem! wow!!
in my model:

ClassRegistry::init('Referente');
$Referente = new Referente();

$Referente->CodiceReferente = $elettorez['Elettore']
['ReferenteElettore']; //CodiceReferente is primary key!!

$oldpreferenze=$Referente->field('PreferenzePrevisteReferente');


$actual=(($elettorez['Elettore']['PersoneCollegate']*
$elettorez['Elettore']['ProbabilitaDiVoto'])/100);

$dataSource = $this->getDataSource();
$dataSource->begin($this);

$newpreferenze=$oldpreferenze+$actual;

if($this->save($elettorez))  // ok
{

if($Referente->saveField('PreferenzePrevisteReferente',
$newpreferenze))  // !! insert!
{
return 
$dataSource->commit($this);
}
}
$dataSource->rollback($this);
return false;

the problem is that saveField make an insert instead of an update

-- 
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: I can find() but can't save(), why?

2011-10-02 Thread AD7six


On Oct 2, 10:46 pm, "reynie...@gmail.com"  wrote:
> I don't use any behavior and the table has just two fields :-(

why dont you debug the save function.

AD

-- 
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: I can find() but can't save(), why?

2011-10-02 Thread CrotchFrog
Turns out that the problem was coming from sanitizing data in the
model's beforeSave() function. Have a closer look at your model
particularly validation and beforeSave functions.

On Oct 2, 4:46 pm, "reynie...@gmail.com"  wrote:
> I don't use any behavior and the table has just two fields :-(
> On Oct 2, 2011 2:50 PM, "Zaky Katalan-Ezra"  wrote:
>
>
>
>
>
>
>
> > Try to leave only one field to save then add fields one by one to get the
> > problematic field.
> > Do you use any behaviors with this model? if you do remove them and try to
> > save.
>
> > On Sun, Oct 2, 2011 at 6:14 PM, CrotchFrog  wrote:
>
> >> Just wondering if this issue has been resolved? I'm having the same
> >> problem with 2.0 RC2.
>
> >> On Sep 30, 4:46 am, "reynie...@gmail.com"  wrote:
> >> > Return "Entro" so it goes trough (!empty($this->data)) :-(
>
> >> > Ing. Reynier Pérez Mira
> >> > Cel: +58 416.921.7406
> >> > Correo: reynie...@gmail.com / reynie...@hotmail.com
>
> >> > On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <
>
> >> > jeremybu...@classoutfit.com> wrote:
> >> > > Try this:
>
> >> > > if (!empty($this->data)) {
> >> > > $this->Modalidad->create();
> >> > > if ($this->Modalidad->save($this->data)) {
> >> > > die("Entro");
> >> > > } else {
> >> > > $this->Session->setFlash('Ocurrieron errores salvando los datos',
> >> > > 'default', array('class' => 'example_class'));
> >> > > die(debug($this->Modalidad->validationErrors));
> >> > > }
> >> > > /* you don't need to use $this->render(), so get rid of it
> >> > > } else {
> >> > > $this->render();
> >> > > */
> >> > > }
>
> >> > > Jeremy Burns
> >> > > Class Outfit
>
> >> > > Tel: +44 (0) 208 123 3822
> >> > > Mob: +44 (0) 7973 481949
> >> > > Skype: jeremy_burns
> >> > >http://www.classoutfit.com
>
> >> --
> >> Our newest site for the community: CakePHP Video Tutorials
> >>http://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email 
> >> to>>cake-php+unsubscribe@googlegroups.comFor more options, visit this group
> >> athttp://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 
> sitehttp://ask.cakephp.organd help
>
> others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email 
> > to>cake-php+unsubscribe@googlegroups.comFor more options, visit this group
>
> athttp://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: I can find() but can't save(), why?

2011-10-02 Thread reynie...@gmail.com
I don't use any behavior and the table has just two fields :-(
On Oct 2, 2011 2:50 PM, "Zaky Katalan-Ezra"  wrote:
> Try to leave only one field to save then add fields one by one to get the
> problematic field.
> Do you use any behaviors with this model? if you do remove them and try to
> save.
>
>
> On Sun, Oct 2, 2011 at 6:14 PM, CrotchFrog  wrote:
>
>> Just wondering if this issue has been resolved? I'm having the same
>> problem with 2.0 RC2.
>>
>> On Sep 30, 4:46 am, "reynie...@gmail.com"  wrote:
>> > Return "Entro" so it goes trough (!empty($this->data)) :-(
>> >
>> > Ing. Reynier Pérez Mira
>> > Cel: +58 416.921.7406
>> > Correo: reynie...@gmail.com / reynie...@hotmail.com
>> >
>> > On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > jeremybu...@classoutfit.com> wrote:
>> > > Try this:
>> >
>> > > if (!empty($this->data)) {
>> > > $this->Modalidad->create();
>> > > if ($this->Modalidad->save($this->data)) {
>> > > die("Entro");
>> > > } else {
>> > > $this->Session->setFlash('Ocurrieron errores salvando los datos',
>> > > 'default', array('class' => 'example_class'));
>> > > die(debug($this->Modalidad->validationErrors));
>> > > }
>> > > /* you don't need to use $this->render(), so get rid of it
>> > > } else {
>> > > $this->render();
>> > > */
>> > > }
>> >
>> > > Jeremy Burns
>> > > Class Outfit
>> >
>> > > Tel: +44 (0) 208 123 3822
>> > > Mob: +44 (0) 7973 481949
>> > > Skype: jeremy_burns
>> > >http://www.classoutfit.com
>>
>> --
>> 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: I can find() but can't save(), why?

2011-10-02 Thread reynie...@gmail.com
Well I'm using 1.3.12 so I didn't know where it fails
On Oct 2, 2011 11:45 AM, "CrotchFrog"  wrote:
> Just wondering if this issue has been resolved? I'm having the same
> problem with 2.0 RC2.
>
> On Sep 30, 4:46 am, "reynie...@gmail.com"  wrote:
>> Return "Entro" so it goes trough (!empty($this->data)) :-(
>>
>> Ing. Reynier Pérez Mira
>> Cel: +58 416.921.7406
>> Correo: reynie...@gmail.com / reynie...@hotmail.com
>>
>> On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <
>>
>>
>>
>>
>>
>>
>>
>> jeremybu...@classoutfit.com> wrote:
>> > Try this:
>>
>> > if (!empty($this->data)) {
>> > $this->Modalidad->create();
>> >  if ($this->Modalidad->save($this->data)) {
>> > die("Entro");
>> > } else {
>> >  $this->Session->setFlash('Ocurrieron errores salvando los datos',
>> > 'default', array('class' => 'example_class'));
>> >  die(debug($this->Modalidad->validationErrors));
>> > }
>> > /* you don't need to use $this->render(), so get rid of it
>> > } else {
>> > $this->render();
>> >  */
>> > }
>>
>> > Jeremy Burns
>> > Class Outfit
>>
>> > Tel: +44 (0) 208 123 3822
>> > Mob: +44 (0) 7973 481949
>> > Skype: jeremy_burns
>> >http://www.classoutfit.com
>
> --
> 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


model->delete() returns false but record gets deleted

2011-10-02 Thread Burningfuses
Hello.
I have the following code in my controller called "comments_controller":

if ($this->Comment->delete($id)) {
...
}

At localhost everything works as expected: the table row with the provided 
ID gets removed and the "if" statement gets executed.
But as soon as I move my code to the server, the if statement doesn't get 
executed, but the row gets deleted from the table.
I don't know what could be causing this and I don't know the best way to 
debug this.
Any help is greatly appreciated.

Thank you.

-- 
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: Cakephp Transaction

2011-10-02 Thread succer...@tiscali.it
Thank you!!
I have found this helpful example 
http://tv.cakephp.org/video/guille1983/2011/01/10/database_transactions
and i have copy the source of 
https://github.com/gmansilla/Transactions-and-Cakephp
so my code in controller is like

function add()
{
if(isset($this->data))
{
$authstring=$this->Session->read('Auth.User');
$referente=$authstring['username'];
$this->data['Elettore']['ReferenteElettore']=$referente;

if($this->Elettore->aggiungi($this->data, $referente))


and inside my model the function "aggiungi" but when i try to add
stuff, i got this:

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'aggiungi' at line 1 [CORE/cake/libs/model/datasources/
dbo_source.php, line 684]

Why cakephp try to exec sql query "aggiungi"? :(

my model is

class Elettore extends AppModel {
   var $useTable = 'elettores';
var $name = 'Elettore';

[...]

function aggiungi($data, $referente){
if ($data && $referente) {

ClassRegistry::init('Referente'); //get an instance of 
Model
Referente

$Referente = new Referente();
...
transaction stuff
...

-- 
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: I can find() but can't save(), why?

2011-10-02 Thread Zaky Katalan-Ezra
Try to leave only one field to save then add fields one by one to get the
problematic field.
Do you use any behaviors with this model? if you do remove them and try to
save.


On Sun, Oct 2, 2011 at 6:14 PM, CrotchFrog  wrote:

> Just wondering if this issue has been resolved? I'm having the same
> problem with 2.0 RC2.
>
> On Sep 30, 4:46 am, "reynie...@gmail.com"  wrote:
> > Return "Entro" so it goes trough (!empty($this->data)) :-(
> >
> > Ing. Reynier Pérez Mira
> > Cel: +58 416.921.7406
> > Correo: reynie...@gmail.com / reynie...@hotmail.com
> >
> > On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <
> >
> >
> >
> >
> >
> >
> >
> > jeremybu...@classoutfit.com> wrote:
> > > Try this:
> >
> > > if (!empty($this->data)) {
> > > $this->Modalidad->create();
> > >  if ($this->Modalidad->save($this->data)) {
> > > die("Entro");
> > > } else {
> > >  $this->Session->setFlash('Ocurrieron errores salvando los datos',
> > > 'default', array('class' => 'example_class'));
> > >  die(debug($this->Modalidad->validationErrors));
> > > }
> > > /* you don't need to use $this->render(), so get rid of it
> > > } else {
> > > $this->render();
> > >  */
> > > }
> >
> > > Jeremy Burns
> > > Class Outfit
> >
> > > Tel: +44 (0) 208 123 3822
> > > Mob: +44 (0) 7973 481949
> > > Skype: jeremy_burns
> > >http://www.classoutfit.com
>
> --
> 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: I can find() but can't save(), why?

2011-10-02 Thread CrotchFrog
Just wondering if this issue has been resolved? I'm having the same
problem with 2.0 RC2.

On Sep 30, 4:46 am, "reynie...@gmail.com"  wrote:
> Return "Entro" so it goes trough (!empty($this->data)) :-(
>
> Ing. Reynier Pérez Mira
> Cel: +58 416.921.7406
> Correo: reynie...@gmail.com / reynie...@hotmail.com
>
> On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <
>
>
>
>
>
>
>
> jeremybu...@classoutfit.com> wrote:
> > Try this:
>
> > if (!empty($this->data)) {
> > $this->Modalidad->create();
> >  if ($this->Modalidad->save($this->data)) {
> > die("Entro");
> > } else {
> >  $this->Session->setFlash('Ocurrieron errores salvando los datos',
> > 'default', array('class' => 'example_class'));
> >  die(debug($this->Modalidad->validationErrors));
> > }
> > /* you don't need to use $this->render(), so get rid of it
> > } else {
> > $this->render();
> >  */
> > }
>
> > Jeremy Burns
> > Class Outfit
>
> > Tel: +44 (0) 208 123 3822
> > Mob: +44 (0) 7973 481949
> > Skype: jeremy_burns
> >http://www.classoutfit.com

-- 
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: Make link disabled

2011-10-02 Thread euromark
or use 'javascript:void(0)' as link


On 1 Okt., 22:09, Ryan Schmidt  wrote:
> On Oct 1, 2011, at 13:47, Dominik Gajewski wrote:
>
> > How to make in Cake link disabled??
> > Html->link('name',      array('controller' => 'bookings',
> > 'action' => 'book'),
> >                                                    array('disabled' => 
> > 'disabled')); ?>
>
> > This is not working
>
> I'm not aware of the HTML "A" tag supporting a "disabled" attribute. If you 
> want a link to not do anything when clicked, don't output a link in the first 
> place; just output the text, perhaps enclosed in a span so you can style it 
> to look like a disabled link.

-- 
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: Cakephp Transaction

2011-10-02 Thread Toby G
Don't forget that your d/b table engine needs to support
transactions...

"For transactions to work correctly in MySQL your tables must use
InnoDB engine. Remember that MyISAM tables do not support
transactions." - from SaveAll page of manual http://bit.ly/nUJyv2



On Sep 30, 11:42 pm, "succer...@tiscali.it" 
wrote:
> Hi everybody! :)
>
> I'm trying to understand how to use transactions in cakephp:
> i have this 2 different table, let's say
> A: name, surname, id, code_b, data, point
> B: name, surname, id, code, score
>
> and when i make an insert into A i have to update the score of B,
> adding the point of A.
>
> i wrote something like:
>
> function add()
>     {
>         if(isset($this->data))
>         {
>                 Controller::loadModel('Father');
>                 $authstring=$this->Session->read('Auth.User');
>         $Father=$authstring['CodeB'];
>
>         $this->data['A']['Father']=$Father;
>
>         $dataSource->begin($this);
>
>         if ($Father=$this->Father->find('first', array('conditions' =>
> array('CodiceFather' => $this->data['FatherA']
>         {
>                 $oldScore=$Father['PreferenzePrevisteReferenze'];
>                 
> $newScore=($tihs->Data['PersoneCollegate']*$this->Data['ProbabilitaDiVoto'])/100;
>
>                 $totScorei=$oldScore+$nuoviScore;
>                 if($this->A->save($this->data))
>                 {
>                         if($this->Father->set('Score', $totScore))
>                                 {
>                                 $dataSource->commit($this);
>                                 $this->Session->setFlash("new A was saved");
>                                 }
>                         else {
>                                 $this->Session->setFlash('Errore UPDATE');
>                                 $dataSource->rollback($this);
>                         }
>                 }
>                 else {
>                         $this->Session->setFlash('Errore insert');
>                         $dataSource->rollback($this);
>                 }
>         }
>         else {
>                 $this->Session->setFlash('errore FIND');
>                 $dataSource->rollback($this);
>              }
>         }
>
>     }
>
> is this the right way to do it? I get an error if in the A model i put
> $dataSource = $this->getDataSource();
>
> (Parse error: syntax error, unexpected T_VARIABLE )
>
> THANK YOUU!

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