Re: $useTable = false - ignored

2010-07-21 Thread Xander
I have Aro and Aco tables and whole ACL is working just fine.
GroupsController operates on both using separate Aco and Aro objects
(using aliases as keys). Model is used only for data validation in
group edit form - it doesn't need any table. I'm not using it to any
read, find or save operations. I could use additional table 'groups'
to keep more information about groups there (and I will probably do
so) but for now I would only know what causes Cake to check that
'groups' table when I'm telling it that doesn't exist and I don't want
to do anything with that.

On 21 Lip, 20:35, cricket  wrote:
> On Wed, Jul 21, 2010 at 9:55 AM, Xander  wrote:
>
> > Second model is used to validate the GroupsController edit form. After
> > validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> > are in both trees, contents in aco only) using separate Aco and Aro
> > objects. I set useTable to false here too, but when using $this->Group-
> >>validates() Cake yells "Table ncube.groups doesn't exist (...)
>
> You cannot associate a model with ARO or ACO if there are no records
> for it in the DB. You must have a groups table so that groups.id key
> can be included in aros table.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: $useTable = false - ignored

2010-07-21 Thread cricket
On Wed, Jul 21, 2010 at 9:55 AM, Xander  wrote:
>
> Second model is used to validate the GroupsController edit form. After
> validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> are in both trees, contents in aco only) using separate Aco and Aro
> objects. I set useTable to false here too, but when using $this->Group-
>>validates() Cake yells "Table ncube.groups doesn't exist (...)

You cannot associate a model with ARO or ACO if there are no records
for it in the DB. You must have a groups table so that groups.id key
can be included in aros table.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: $useTable = false - ignored

2010-07-21 Thread Xander
Actually I tried, but I'm not sure if I did it correctly. Here's my
model:


 array(
  'type' => 'integer',
  'key' => 'primary',
  'length' => 11
),
'parent' => array(
  'type' => 'integer',
  'length' => 11
),
'alias' => array(
  'type' => 'string',
  'length' => 255
)
  );
  var $validate = array(
'alias' => array(
  'alphaNumeric' => array(
'rule' => 'alphaNumeric',
'message' => 'Pole zawiera niedozwolone znaki'
  ),
  'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'Pole nie może być puste',
  ),
  'between' => array(
'rule' => array('between', 5, 255),
'message' => 'Pole musi zawierać od 5 do 255 znaków',
  )
),
'parent' => array(
  'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'Pole nie może być puste',
  )
)
  );



}


On 21 Lip, 18:28, Nabil Alsharif  wrote:
> Try setting the $schema variable in the model.
>
>
>
> On Wed, Jul 21, 2010 at 8:55 AM, Xander  wrote:
> > Hello.
> > I'm developing applications with user's and content's groups based on
> > ACL trees.
> > In my app I have 2 models without any tables. Models are used because
> > I want to use automatic validation. First model is for
> > ContactsController. There is no table used, so I set Contact::
> > $useTable to false and everything is working just fine.
> > Second model is used to validate the GroupsController edit form. After
> > validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> > are in both trees, contents in aco only) using separate Aco and Aro
> > objects. I set useTable to false here too, but when using $this->Group-
> >>validates() Cake yells "Table ncube.groups doesn't exist (...)
> > Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
> > `Group`.`id` = '7'   ". I don't know if it's important but my table
> > prefix is also ignored here. There was no warning when Group::
> > $validate was an empty array.
> > As a work around I put '@' before $this->Group->validates() .
> > The controller itself is working just fine. Data are validated and
> > saved properly. I don't know where to look for bugs.
>
> > P.S. Sorry for my english.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: $useTable = false - ignored

2010-07-21 Thread Xander
I'm sure both model's classname and filename are correct, otherwise
validation wouldn't work at all. I tripple checked if I didn't made
model's name plural or something - just for case.

On 21 Lip, 19:41, "Dr. Loboto"  wrote:
> Ignored model properties and methods in 99.9% of cases is wrong model
> filename so it is not loaded at all.
>
> On Jul 21, 8:55 pm, Xander  wrote:
>
>
>
> > Hello.
> > I'm developing applications with user's and content's groups based on
> > ACL trees.
> > In my app I have 2 models without any tables. Models are used because
> > I want to use automatic validation. First model is for
> > ContactsController. There is no table used, so I set Contact::
> > $useTable to false and everything is working just fine.
> > Second model is used to validate the GroupsController edit form. After
> > validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> > are in both trees, contents in aco only) using separate Aco and Aro
> > objects. I set useTable to false here too, but when using 
> > $this->Group->validates() Cake yells "Table ncube.groups doesn't exist (...)
>
> > Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
> > `Group`.`id` = '7'   ". I don't know if it's important but my table
> > prefix is also ignored here. There was no warning when Group::
> > $validate was an empty array.
> > As a work around I put '@' before $this->Group->validates() .
> > The controller itself is working just fine. Data are validated and
> > saved properly. I don't know where to look for bugs.
>
> > P.S. Sorry for my english.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: $useTable = false - ignored

2010-07-21 Thread Dr. Loboto
Ignored model properties and methods in 99.9% of cases is wrong model
filename so it is not loaded at all.

On Jul 21, 8:55 pm, Xander  wrote:
> Hello.
> I'm developing applications with user's and content's groups based on
> ACL trees.
> In my app I have 2 models without any tables. Models are used because
> I want to use automatic validation. First model is for
> ContactsController. There is no table used, so I set Contact::
> $useTable to false and everything is working just fine.
> Second model is used to validate the GroupsController edit form. After
> validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> are in both trees, contents in aco only) using separate Aco and Aro
> objects. I set useTable to false here too, but when using 
> $this->Group->validates() Cake yells "Table ncube.groups doesn't exist (...)
>
> Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
> `Group`.`id` = '7'   ". I don't know if it's important but my table
> prefix is also ignored here. There was no warning when Group::
> $validate was an empty array.
> As a work around I put '@' before $this->Group->validates() .
> The controller itself is working just fine. Data are validated and
> saved properly. I don't know where to look for bugs.
>
> P.S. Sorry for my english.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: $useTable = false - ignored

2010-07-21 Thread Nabil Alsharif
Try setting the $schema variable in the model.

On Wed, Jul 21, 2010 at 8:55 AM, Xander  wrote:
> Hello.
> I'm developing applications with user's and content's groups based on
> ACL trees.
> In my app I have 2 models without any tables. Models are used because
> I want to use automatic validation. First model is for
> ContactsController. There is no table used, so I set Contact::
> $useTable to false and everything is working just fine.
> Second model is used to validate the GroupsController edit form. After
> validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> are in both trees, contents in aco only) using separate Aco and Aro
> objects. I set useTable to false here too, but when using $this->Group-
>>validates() Cake yells "Table ncube.groups doesn't exist (...)
> Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
> `Group`.`id` = '7'   ". I don't know if it's important but my table
> prefix is also ignored here. There was no warning when Group::
> $validate was an empty array.
> As a work around I put '@' before $this->Group->validates() .
> The controller itself is working just fine. Data are validated and
> saved properly. I don't know where to look for bugs.
>
> P.S. Sorry for my english.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


$useTable = false - ignored

2010-07-21 Thread Xander
Hello.
I'm developing applications with user's and content's groups based on
ACL trees.
In my app I have 2 models without any tables. Models are used because
I want to use automatic validation. First model is for
ContactsController. There is no table used, so I set Contact::
$useTable to false and everything is working just fine.
Second model is used to validate the GroupsController edit form. After
validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
are in both trees, contents in aco only) using separate Aco and Aro
objects. I set useTable to false here too, but when using $this->Group-
>validates() Cake yells "Table ncube.groups doesn't exist (...)
Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
`Group`.`id` = '7'   ". I don't know if it's important but my table
prefix is also ignored here. There was no warning when Group::
$validate was an empty array.
As a work around I put '@' before $this->Group->validates() .
The controller itself is working just fine. Data are validated and
saved properly. I don't know where to look for bugs.

P.S. Sorry for my english.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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