#6194: Error: Database table app_models for model AppModel was not found. --------------------------+------------------------------------------------- Reporter: yaman666 | Type: Bug Status: new | Priority: Medium Milestone: 1.2.x.x | Component: General Version: 1.2 Final | Severity: Normal Keywords: | Php_version: n/a Cake_version: | --------------------------+------------------------------------------------- I get this error message when I use hasAndBelongsToMany and have a constructor in AppModel, i.e. when BOTH of the following conditions are met:[[BR]] [[BR]] 1) Create "AppModel extends Model" class in app\models\app_model.php
Inside AppModel class set constructor function: {{{ public function __construct() { parent::__construct(); } }}} 2) Create a hasAndBelongsToMany relationship. I used "User" and "Group" models (set up proper tables users, groups and group_users) where "User" model had: {{{ public $hasAndBelongsToMany = array("Group"); }}} When I uncomment either the {{{function __construct() {}}}} in AppModel or {{{public $hasandBelongsToMany}}} in User model, that error goes away. But with both of these conditions it always appears. [[BR]] [[BR]] When I created app_models table, just to see what would happen, it attempted to join AppModel on all the tables present in the relationship, i.e. groups in this case and I had an error: "Unknown column 'AppModel.user_id' in 'on clause'" -- Ticket URL: <https://trac.cakephp.org/ticket/6194> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---