Uninitialized string offset notice

2009-09-29 Thread borcho

My cakephp applications works fine on my local server. On my web
server, I get the following error notice (the data does get saved,
though):

Notice (8): Uninitialized string offset: 0 [CORE/cake/libs/model/
model.php, line 1319]
Code | Context
Model::__saveMulti() - CORE/cake/libs/model/model.php, line 1319
Model::save() - CORE/cake/libs/model/model.php, line 1239

Line 1319 in model php is:
} elseif (isset($row[$join][$this->hasAndBelongsToMany[$assoc]
['associationForeignKey']])) {
$newData[] = $row[$join];

Any ideas of what I should look into fixing?

Thanks,

B.
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



callback question

2009-09-23 Thread borcho

How do I access a variable from action ABC from afterFilter ()? For
example, I have logic performed in function foe () and a bunch of
variables, and then after the view of foe is rendered, I would like to
use afterFilter to save all data. However, I cannot figure out how to
pass variables between two different functions in the same class.
Thanks.


--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM child model order

2009-09-21 Thread borcho

nevermind. I figured it out - defined order in the other model class.

On Sep 21, 4:21 pm, borcho  wrote:
> How do I set the order in child model in HABTM when running find in
> parent view? I cannot get it to work. Thanks.
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM child model order

2009-09-21 Thread borcho

How do I set the order in child model in HABTM when running find in
parent view? I cannot get it to work. Thanks.
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



url parameters + logic + save

2009-09-20 Thread borcho

Still getting my hands around cakephp. Trying to figure out what the
best way is to put together a jump page that performs logic based on
url parameters and cookie variables, saves data to model and redirects
page without any input fields or user triggered actions. For exampe,

www.domain.com/page?user=abx&stats=xyz

Need to perform some logic with passed variables + cookie variables,
save data and then redirects page.

Can this be done by running logic and actions in models and controller
or do I need to do this in view and use requestaction?

Thanks.



--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: controller setup - pagination

2009-09-16 Thread borcho

Thanks!

On Sep 16, 2:11 am, Cosmin Paul  wrote:
> This is correct :
> $this->paginate('Product');
>
>
>
> On Wed, Sep 16, 2009 at 7:10 AM, borcho  wrote:
>
> > Hi,
>
> > I am new to CakaPHP and I cannot figure out how to paginate products
> > listed under a category (many to many relationship) and also use
> > category table fields in the same view. I set up my controller like
> > this but I am pretty sure it's wrong even though it works. Any
> > feedback would be appreciated. Thanks.
>
> > class StoresController extends AppController {
>
> >        var $name = 'Stores';
> >        var $helpers = array('Html', 'Form');
> >        var $paginate = array('Products'=>array('limit'=>5));
>
> >        function view($id = null) {
> >                if (!$id) {
> >                        $this->flash(__('Invalid Store', true), 
> > array('action'=>'index'));
> >                }
> >        $this->set('products', $this->paginate($this->Store->Product));
> >        $this->set('store', $this->Store->findById($id));
> >                }
>
> > }
>
> --
> Paul-Cosmin Constandachi
> Tel: 0723.46.46.42
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



controller setup - pagination

2009-09-15 Thread borcho

Hi,

I am new to CakaPHP and I cannot figure out how to paginate products
listed under a category (many to many relationship) and also use
category table fields in the same view. I set up my controller like
this but I am pretty sure it's wrong even though it works. Any
feedback would be appreciated. Thanks.

class StoresController extends AppController {

var $name = 'Stores';
var $helpers = array('Html', 'Form');
var $paginate = array('Products'=>array('limit'=>5));

function view($id = null) {
if (!$id) {
$this->flash(__('Invalid Store', true), 
array('action'=>'index'));
}
$this->set('products', $this->paginate($this->Store->Product));
$this->set('store', $this->Store->findById($id));
}

}

--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---