Re: Associated model won't load

2010-02-18 Thread John Andersen
Hmm, could have been the model cache maybe :)
Well, good that it seems solved!
Enjoy,
   John

On Feb 18, 6:03 am, Furuno furunom...@gmail.com wrote:
 Well, yesterday, I try to re-create the app and database from scracth,
 copy paste the code again, and, for some reason... it works... and now
 I left in wonder...

 @ John Andersen :
 Actually this project is very nearing completion and will be released
 as an open source application. Even it already has the Google Code
 project page :)http://code.google.com/p/choco-test

 On 17 Feb, 15:36, John Andersen j.andersen...@gmail.com wrote:

  I can give it a try in my development site, if you would like me to
  try!
  Probably only need the two controllers with models!
     John

  On Feb 17, 9:13 am, Furuno furunom...@gmail.com wrote:

   Okay somebody please tell me that this is some kind of mystical
   phenomenon : yeah, I've tried using containable behaviors, not using
   pagination, not using admin routes, redownload the cakephp library,
   reinstalling apache and mysql, and anything I can think about other
   that reinstall the OS and upgrading my hardware :).

   Just FYI, in the previous version, all models uses the same
   controllers, the AdminsController, should I revert back to that? And
   of course, it works like a charm, only not so elegant to do so...

   On 17 Feb, 05:29, Furuno furunom...@gmail.com wrote:

WIll try once I got to back to my office (it's 6.30 AM currently)...
thanks!

On 17 Feb, 03:58, John Andersen j.andersen...@gmail.com wrote:

 I assume that you are not using the Containable behaviour, so my last
 suggestion is - have a look at the Containable behaviour, I use it
 myself and it saved a lot of time when I want to be sure that I
 retrieve not only one model but also associated models from up to
 several levels of associations.
 Hope you find the issue!!! and tell us what the issue was, so we too
 may learn :)
 Enjoy,
    John

 On Feb 16, 10:36 pm, Furuno furunom...@gmail.com wrote:

  Well, actually, yes... :)

  To make sure that everything runs fine, I'm actually creating the
  refinements of my final prototype application (an online exam 
  system),
  and I've obviously copy paste anything from the protype code, the 
  new
  stuff here is just pagination. I've tried removing pagination too,
  with no luck... Oddly enough, the prototype runs extremely well...

  On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:

   Have you checked that the Subject model filename is subject.php?
   And the model is named Subject not subject?
   Just trying to throw something around, which usually creates these
   kind of problems :)
   Maybe copy/paste the Subject model into a post!
      John

   On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried 
   that too... still no luck... Really, I think I've exhausted a
lot of methods already but still can't fix it...

On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

 Damn :) Ok, have you tried adding the uses variable?

 [code]
    var $uses = array('Subject');
 [/code]

 in the Subjects controller!
    John

   [snip]

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: Associated model won't load

2010-02-17 Thread John Andersen
I can give it a try in my development site, if you would like me to
try!
Probably only need the two controllers with models!
   John

On Feb 17, 9:13 am, Furuno furunom...@gmail.com wrote:
 Okay somebody please tell me that this is some kind of mystical
 phenomenon : yeah, I've tried using containable behaviors, not using
 pagination, not using admin routes, redownload the cakephp library,
 reinstalling apache and mysql, and anything I can think about other
 that reinstall the OS and upgrading my hardware :).

 Just FYI, in the previous version, all models uses the same
 controllers, the AdminsController, should I revert back to that? And
 of course, it works like a charm, only not so elegant to do so...

 On 17 Feb, 05:29, Furuno furunom...@gmail.com wrote:

  WIll try once I got to back to my office (it's 6.30 AM currently)...
  thanks!

  On 17 Feb, 03:58, John Andersen j.andersen...@gmail.com wrote:

   I assume that you are not using the Containable behaviour, so my last
   suggestion is - have a look at the Containable behaviour, I use it
   myself and it saved a lot of time when I want to be sure that I
   retrieve not only one model but also associated models from up to
   several levels of associations.
   Hope you find the issue!!! and tell us what the issue was, so we too
   may learn :)
   Enjoy,
      John

   On Feb 16, 10:36 pm, Furuno furunom...@gmail.com wrote:

Well, actually, yes... :)

To make sure that everything runs fine, I'm actually creating the
refinements of my final prototype application (an online exam system),
and I've obviously copy paste anything from the protype code, the new
stuff here is just pagination. I've tried removing pagination too,
with no luck... Oddly enough, the prototype runs extremely well...

On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:

 Have you checked that the Subject model filename is subject.php?
 And the model is named Subject not subject?
 Just trying to throw something around, which usually creates these
 kind of problems :)
 Maybe copy/paste the Subject model into a post!
    John

 On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that 
 too... still no luck... Really, I think I've exhausted a
  lot of methods already but still can't fix it...

  On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

   Damn :) Ok, have you tried adding the uses variable?

   [code]
      var $uses = array('Subject');
   [/code]

   in the Subjects controller!
      John

 [snip]

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: Associated model won't load

2010-02-16 Thread andy
Does it work if you try doing a $this-Subject-find() instead of
using paginate?  Just to see if that works...



On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:
 Okay, so, I have two models called Program and Subject, here's the
 classes :

 program.php
 ?php
 class Program extends AppModel {
         var $hasMany = 'Subject';}

 ?

 subject.php
 ?php
 class Subject extends AppModel {
         var $belongsTo = 'Program'}

 ?

 And the controllers :

 programs_controller.php
 ?php
 class ProgramsController extends AppController {

         var $paginate = array('limit' = 20);

         function admin_index() {
                 $this-set('programs', $this-paginate('Program'));
         }}

 ?

 subjects_controller.php
 ?php
 class SubjectsController extends AppController {

         var $paginate = array('limit' = 20);

         function admin_index() {
                 $this-set('subjects', $this-paginate('Subject'));
         }

 }

 ?

 The problem is, why the subject controller won't load the associated
 models while all the other controllers (programs and periodes) does it
 just find?

 Here's the SQL debug message from programs controller, it loads the
 associated Subjects :
 DESCRIBE `programs`
 DESCRIBE `subjects`
 SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
 SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
 `Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 LIMIT
 20
 SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
 `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
 `subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

 But in the subjects controller it doesn't load the associated
 Programs :
 DESCRIBE `subjects`
 SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
 SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
 `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
 `subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

 I've tried adding a complete association definition array to the
 models, complete pagination definition array, using var $name but
 still no luck :(

 Where did I went wrong? Have debugged this for the last 2 hours...

 Thanks before...

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: Associated model won't load

2010-02-16 Thread Furuno
Nope... :(

Just to make sure, I tried that once again with :
$this-set('subjects', $this-Subject-find('all'));

still no luck...

On 17 Feb, 00:56, andy sum...@gmail.com wrote:
 Does it work if you try doing a $this-Subject-find() instead of
 using paginate?  Just to see if that works...

 On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:



  Okay, so, I have two models called Program and Subject, here's the
  classes :

  program.php
  ?php
  class Program extends AppModel {
          var $hasMany = 'Subject';}

  ?

  subject.php
  ?php
  class Subject extends AppModel {
          var $belongsTo = 'Program'}

  ?

  And the controllers :

  programs_controller.php
  ?php
  class ProgramsController extends AppController {

          var $paginate = array('limit' = 20);

          function admin_index() {
                  $this-set('programs', $this-paginate('Program'));
          }}

  ?

  subjects_controller.php
  ?php
  class SubjectsController extends AppController {

          var $paginate = array('limit' = 20);

          function admin_index() {
                  $this-set('subjects', $this-paginate('Subject'));
          }

  }

  ?

  The problem is, why the subject controller won't load the associated
  models while all the other controllers (programs and periodes) does it
  just find?

  Here's the SQL debug message from programs controller, it loads the
  associated Subjects :
  DESCRIBE `programs`
  DESCRIBE `subjects`
  SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
  SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
  `Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 LIMIT
  20
  SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
  `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
  `subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

  But in the subjects controller it doesn't load the associated
  Programs :
  DESCRIBE `subjects`
  SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
  SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
  `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
  `subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

  I've tried adding a complete association definition array to the
  models, complete pagination definition array, using var $name but
  still no luck :(

  Where did I went wrong? Have debugged this for the last 2 hours...

  Thanks before...

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: Associated model won't load

2010-02-16 Thread andy
Do you know what version of CakePHP you are running?



On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote:
 Nope... :(

 Just to make sure, I tried that once again with :
 $this-set('subjects', $this-Subject-find('all'));

 still no luck...

 On 17 Feb, 00:56, andy sum...@gmail.com wrote:



  Does it work if you try doing a $this-Subject-find() instead of
  using paginate?  Just to see if that works...

  On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:

   Okay, so, I have two models called Program and Subject, here's the
   classes :

   program.php
   ?php
   class Program extends AppModel {
           var $hasMany = 'Subject';}

   ?

   subject.php
   ?php
   class Subject extends AppModel {
           var $belongsTo = 'Program'}

   ?

   And the controllers :

   programs_controller.php
   ?php
   class ProgramsController extends AppController {

           var $paginate = array('limit' = 20);

           function admin_index() {
                   $this-set('programs', $this-paginate('Program'));
           }}

   ?

   subjects_controller.php
   ?php
   class SubjectsController extends AppController {

           var $paginate = array('limit' = 20);

           function admin_index() {
                   $this-set('subjects', $this-paginate('Subject'));
           }

   }

   ?

   The problem is, why the subject controller won't load the associated
   models while all the other controllers (programs and periodes) does it
   just find?

   Here's the SQL debug message from programs controller, it loads the
   associated Subjects :
   DESCRIBE `programs`
   DESCRIBE `subjects`
   SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
   SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
   `Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 LIMIT
   20
   SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
   `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
   `subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

   But in the subjects controller it doesn't load the associated
   Programs :
   DESCRIBE `subjects`
   SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
   SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
   `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
   `subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

   I've tried adding a complete association definition array to the
   models, complete pagination definition array, using var $name but
   still no luck :(

   Where did I went wrong? Have debugged this for the last 2 hours...

   Thanks before...

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: Associated model won't load

2010-02-16 Thread Furuno
1.2.6...

On 17 Feb, 01:57, andy sum...@gmail.com wrote:
 Do you know what version of CakePHP you are running?

 On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote:



  Nope... :(

  Just to make sure, I tried that once again with :
  $this-set('subjects', $this-Subject-find('all'));

  still no luck...

  On 17 Feb, 00:56, andy sum...@gmail.com wrote:

   Does it work if you try doing a $this-Subject-find() instead of
   using paginate?  Just to see if that works...

   On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:

Okay, so, I have two models called Program and Subject, here's the
classes :

program.php
?php
class Program extends AppModel {
        var $hasMany = 'Subject';}

?

subject.php
?php
class Subject extends AppModel {
        var $belongsTo = 'Program'}

?

And the controllers :

programs_controller.php
?php
class ProgramsController extends AppController {

        var $paginate = array('limit' = 20);

        function admin_index() {
                $this-set('programs', $this-paginate('Program'));
        }}

?

subjects_controller.php
?php
class SubjectsController extends AppController {

        var $paginate = array('limit' = 20);

        function admin_index() {
                $this-set('subjects', $this-paginate('Subject'));
        }

}

?

The problem is, why the subject controller won't load the associated
models while all the other controllers (programs and periodes) does it
just find?

Here's the SQL debug message from programs controller, it loads the
associated Subjects :
DESCRIBE `programs`
DESCRIBE `subjects`
SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
`Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 LIMIT
20
SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
`Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
`subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

But in the subjects controller it doesn't load the associated
Programs :
DESCRIBE `subjects`
SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
`Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
`subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

I've tried adding a complete association definition array to the
models, complete pagination definition array, using var $name but
still no luck :(

Where did I went wrong? Have debugged this for the last 2 hours...

Thanks before...

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: Associated model won't load

2010-02-16 Thread John Andersen
Are you missing a semicolon in this code?

[code]
?php
class Subject extends AppModel {
var $belongsTo = 'Program'
}
?
[/code]

just after 'Program' ? or was it a type in the post :)
Enjoy,
   John

On Feb 16, 9:01 pm, Furuno furunom...@gmail.com wrote:
 1.2.6...

 On 17 Feb, 01:57, andy sum...@gmail.com wrote:

  Do you know what version of CakePHP you are running?

  On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote:

   Nope... :(

   Just to make sure, I tried that once again with :
   $this-set('subjects', $this-Subject-find('all'));

   still no luck...

   On 17 Feb, 00:56, andy sum...@gmail.com wrote:

Does it work if you try doing a $this-Subject-find() instead of
using paginate?  Just to see if that works...

On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:

 Okay, so, I have two models called Program and Subject, here's the
 classes :

 program.php
 ?php
 class Program extends AppModel {
         var $hasMany = 'Subject';}

 ?

 subject.php
 ?php
 class Subject extends AppModel {
         var $belongsTo = 'Program'}

 ?

 And the controllers :

 programs_controller.php
 ?php
 class ProgramsController extends AppController {

         var $paginate = array('limit' = 20);

         function admin_index() {
                 $this-set('programs', $this-paginate('Program'));
         }}

 ?

 subjects_controller.php
 ?php
 class SubjectsController extends AppController {

         var $paginate = array('limit' = 20);

         function admin_index() {
                 $this-set('subjects', $this-paginate('Subject'));
         }

 }

 ?

 The problem is, why the subject controller won't load the associated
 models while all the other controllers (programs and periodes) does it
 just find?

 Here's the SQL debug message from programs controller, it loads the
 associated Subjects :
 DESCRIBE `programs`
 DESCRIBE `subjects`
 SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
 SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
 `Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 LIMIT
 20
 SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
 `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
 `subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

 But in the subjects controller it doesn't load the associated
 Programs :
 DESCRIBE `subjects`
 SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
 SELECT `Subject`.`id`, `Subject`.`program_id`, `Subject`.`periode_id`,
 `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
 `subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

 I've tried adding a complete association definition array to the
 models, complete pagination definition array, using var $name but
 still no luck :(

 Where did I went wrong? Have debugged this for the last 2 hours...

 Thanks before...

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: Associated model won't load

2010-02-16 Thread Furuno
well, I'm afraid it's only in the post...

On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com wrote:
 Are you missing a semicolon in this code?

 [code]
 ?php
 class Subject extends AppModel {
         var $belongsTo = 'Program'}

 ?
 [/code]

 just after 'Program' ? or was it a type in the post :)
 Enjoy,
    John

 On Feb 16, 9:01 pm, Furuno furunom...@gmail.com wrote:



  1.2.6...

  On 17 Feb, 01:57, andy sum...@gmail.com wrote:

   Do you know what version of CakePHP you are running?

   On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote:

Nope... :(

Just to make sure, I tried that once again with :
$this-set('subjects', $this-Subject-find('all'));

still no luck...

On 17 Feb, 00:56, andy sum...@gmail.com wrote:

 Does it work if you try doing a $this-Subject-find() instead of
 using paginate?  Just to see if that works...

 On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote:

  Okay, so, I have two models called Program and Subject, here's the
  classes :

  program.php
  ?php
  class Program extends AppModel {
          var $hasMany = 'Subject';}

  ?

  subject.php
  ?php
  class Subject extends AppModel {
          var $belongsTo = 'Program'}

  ?

  And the controllers :

  programs_controller.php
  ?php
  class ProgramsController extends AppController {

          var $paginate = array('limit' = 20);

          function admin_index() {
                  $this-set('programs', $this-paginate('Program'));
          }}

  ?

  subjects_controller.php
  ?php
  class SubjectsController extends AppController {

          var $paginate = array('limit' = 20);

          function admin_index() {
                  $this-set('subjects', $this-paginate('Subject'));
          }

  }

  ?

  The problem is, why the subject controller won't load the associated
  models while all the other controllers (programs and periodes) does 
  it
  just find?

  Here's the SQL debug message from programs controller, it loads the
  associated Subjects :
  DESCRIBE `programs`
  DESCRIBE `subjects`
  SELECT COUNT(*) AS `count` FROM `programs` AS `Program` WHERE 1 = 1
  SELECT `Program`.`id`, `Program`.`code`, `Program`.`name`,
  `Program`.`description` FROM `programs` AS `Program` WHERE 1 = 1 
  LIMIT
  20
  SELECT `Subject`.`id`, `Subject`.`program_id`, 
  `Subject`.`periode_id`,
  `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
  `subjects` AS `Subject` WHERE `Subject`.`program_id` IN (1, 2, 3)

  But in the subjects controller it doesn't load the associated
  Programs :
  DESCRIBE `subjects`
  SELECT COUNT(*) AS `count` FROM `subjects` AS `Subject` WHERE 1 = 1
  SELECT `Subject`.`id`, `Subject`.`program_id`, 
  `Subject`.`periode_id`,
  `Subject`.`code`, `Subject`.`name`, `Subject`.`description` FROM
  `subjects` AS `Subject` WHERE 1 = 1 LIMIT 20

  I've tried adding a complete association definition array to the
  models, complete pagination definition array, using var $name but
  still no luck :(

  Where did I went wrong? Have debugged this for the last 2 hours...

  Thanks before...

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: Associated model won't load

2010-02-16 Thread John Andersen
Damn :) Ok, have you tried adding the uses variable?

[code]
   var $uses = array('Subject');
[/code]

in the Subjects controller!
   John

On Feb 16, 9:49 pm, Furuno furunom...@gmail.com wrote:
 well, I'm afraid it's only in the post...

 On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com wrote:

  Are you missing a semicolon in this code?

  [code]
  ?php
  class Subject extends AppModel {
          var $belongsTo = 'Program'}

  ?
  [/code]

  just after 'Program' ? or was it a type in the post :)
  Enjoy,
     John

[snip]

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: Associated model won't load

2010-02-16 Thread Furuno
tried that too... still no luck... Really, I think I've exhausted a
lot of methods already but still can't fix it...

On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:
 Damn :) Ok, have you tried adding the uses variable?

 [code]
    var $uses = array('Subject');
 [/code]

 in the Subjects controller!
    John

 On Feb 16, 9:49 pm, Furuno furunom...@gmail.com wrote:



  well, I'm afraid it's only in the post...

  On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com wrote:

   Are you missing a semicolon in this code?

   [code]
   ?php
   class Subject extends AppModel {
           var $belongsTo = 'Program'}

   ?
   [/code]

   just after 'Program' ? or was it a type in the post :)
   Enjoy,
      John

 [snip]

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: Associated model won't load

2010-02-16 Thread John Andersen
Have you checked that the Subject model filename is subject.php?
And the model is named Subject not subject?
Just trying to throw something around, which usually creates these
kind of problems :)
Maybe copy/paste the Subject model into a post!
   John



On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote:
 tried that too... still no luck... Really, I think I've exhausted a
 lot of methods already but still can't fix it...

 On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

  Damn :) Ok, have you tried adding the uses variable?

  [code]
     var $uses = array('Subject');
  [/code]

  in the Subjects controller!
     John

[snip]

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: Associated model won't load

2010-02-16 Thread Furuno
Well, actually, yes... :)

To make sure that everything runs fine, I'm actually creating the
refinements of my final prototype application (an online exam system),
and I've obviously copy paste anything from the protype code, the new
stuff here is just pagination. I've tried removing pagination too,
with no luck... Oddly enough, the prototype runs extremely well...

On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:
 Have you checked that the Subject model filename is subject.php?
 And the model is named Subject not subject?
 Just trying to throw something around, which usually creates these
 kind of problems :)
 Maybe copy/paste the Subject model into a post!
    John

 On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that too... 
 still no luck... Really, I think I've exhausted a
  lot of methods already but still can't fix it...

  On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

   Damn :) Ok, have you tried adding the uses variable?

   [code]
      var $uses = array('Subject');
   [/code]

   in the Subjects controller!
      John

 [snip]

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: Associated model won't load

2010-02-16 Thread John Andersen
I assume that you are not using the Containable behaviour, so my last
suggestion is - have a look at the Containable behaviour, I use it
myself and it saved a lot of time when I want to be sure that I
retrieve not only one model but also associated models from up to
several levels of associations.
Hope you find the issue!!! and tell us what the issue was, so we too
may learn :)
Enjoy,
   John

On Feb 16, 10:36 pm, Furuno furunom...@gmail.com wrote:
 Well, actually, yes... :)

 To make sure that everything runs fine, I'm actually creating the
 refinements of my final prototype application (an online exam system),
 and I've obviously copy paste anything from the protype code, the new
 stuff here is just pagination. I've tried removing pagination too,
 with no luck... Oddly enough, the prototype runs extremely well...

 On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:

  Have you checked that the Subject model filename is subject.php?
  And the model is named Subject not subject?
  Just trying to throw something around, which usually creates these
  kind of problems :)
  Maybe copy/paste the Subject model into a post!
     John

  On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that 
  too... still no luck... Really, I think I've exhausted a
   lot of methods already but still can't fix it...

   On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

Damn :) Ok, have you tried adding the uses variable?

[code]
   var $uses = array('Subject');
[/code]

in the Subjects controller!
   John

  [snip]

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: Associated model won't load

2010-02-16 Thread Furuno
WIll try once I got to back to my office (it's 6.30 AM currently)...
thanks!

On 17 Feb, 03:58, John Andersen j.andersen...@gmail.com wrote:
 I assume that you are not using the Containable behaviour, so my last
 suggestion is - have a look at the Containable behaviour, I use it
 myself and it saved a lot of time when I want to be sure that I
 retrieve not only one model but also associated models from up to
 several levels of associations.
 Hope you find the issue!!! and tell us what the issue was, so we too
 may learn :)
 Enjoy,
    John

 On Feb 16, 10:36 pm, Furuno furunom...@gmail.com wrote:



  Well, actually, yes... :)

  To make sure that everything runs fine, I'm actually creating the
  refinements of my final prototype application (an online exam system),
  and I've obviously copy paste anything from the protype code, the new
  stuff here is just pagination. I've tried removing pagination too,
  with no luck... Oddly enough, the prototype runs extremely well...

  On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:

   Have you checked that the Subject model filename is subject.php?
   And the model is named Subject not subject?
   Just trying to throw something around, which usually creates these
   kind of problems :)
   Maybe copy/paste the Subject model into a post!
      John

   On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that 
   too... still no luck... Really, I think I've exhausted a
lot of methods already but still can't fix it...

On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

 Damn :) Ok, have you tried adding the uses variable?

 [code]
    var $uses = array('Subject');
 [/code]

 in the Subjects controller!
    John

   [snip]

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: Associated model won't load

2010-02-16 Thread Furuno
Okay somebody please tell me that this is some kind of mystical
phenomenon : yeah, I've tried using containable behaviors, not using
pagination, not using admin routes, redownload the cakephp library,
reinstalling apache and mysql, and anything I can think about other
that reinstall the OS and upgrading my hardware :).

Just FYI, in the previous version, all models uses the same
controllers, the AdminsController, should I revert back to that? And
of course, it works like a charm, only not so elegant to do so...

On 17 Feb, 05:29, Furuno furunom...@gmail.com wrote:
 WIll try once I got to back to my office (it's 6.30 AM currently)...
 thanks!

 On 17 Feb, 03:58, John Andersen j.andersen...@gmail.com wrote:

  I assume that you are not using the Containable behaviour, so my last
  suggestion is - have a look at the Containable behaviour, I use it
  myself and it saved a lot of time when I want to be sure that I
  retrieve not only one model but also associated models from up to
  several levels of associations.
  Hope you find the issue!!! and tell us what the issue was, so we too
  may learn :)
  Enjoy,
     John

  On Feb 16, 10:36 pm, Furuno furunom...@gmail.com wrote:

   Well, actually, yes... :)

   To make sure that everything runs fine, I'm actually creating the
   refinements of my final prototype application (an online exam system),
   and I've obviously copy paste anything from the protype code, the new
   stuff here is just pagination. I've tried removing pagination too,
   with no luck... Oddly enough, the prototype runs extremely well...

   On 17 Feb, 03:29, John Andersen j.andersen...@gmail.com wrote:

Have you checked that the Subject model filename is subject.php?
And the model is named Subject not subject?
Just trying to throw something around, which usually creates these
kind of problems :)
Maybe copy/paste the Subject model into a post!
   John

On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that 
too... still no luck... Really, I think I've exhausted a
 lot of methods already but still can't fix it...

 On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote:

  Damn :) Ok, have you tried adding the uses variable?

  [code]
     var $uses = array('Subject');
  [/code]

  in the Subjects controller!
     John

[snip]

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