I was testing it in cake 2.0, but when i figured out that it was a cake problem i tryed to update to 2.1, expecting it to be fixed, but it wasnt
When you try to set up the $actas to the translate behaviour, use belongsto relationship in your models, and try to paginate recursively the results, you get an error.
What i'm trying to do:
Retrieve a list of packages, and for each package in the list, ill print a list of itineraries for that package. To retrieve this content, i'm using $this->{$model_name}->recursive = 2.
If i comment the lines of the actas, the page works and displays the list of packages and itineraries for each package, but all in the default language. If i add the actas, and use recursive = 1, it also works, but do not give me the itinerary data that i need to display in each package.
Ill give you my model structure.
Package hasmany ItineraryPackages
Itinerary hasmany ItineraryPackages
ItineraryPackages belongsto Package
ItineraryPackages belongsto Itinerary
Why i'm not using the HABTM relation?
Because the ItineraryPackages has a description and order field. The description of ItineraryPackages is also using the translate behaviour for the column description.
Fatal Error (256): [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'I18n__nameTranslation.content' in 'field list' [#0](/projects/42648/tickets/0 "Ticket #0") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(437): PDOStatement->execute(Array) [#1](/projects/42648/tickets/1 "Ticket #1") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(403): DboSource->_execute('SELECT `Package...', Array) [#2](/projects/42648/tickets/2 "Ticket #2") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(647): DboSource->execute('SELECT `Package...', Array, Array) [#3](/projects/42648/tickets/3 "Ticket #3") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(1300): DboSource->fetchAll('SELECT `Package...', false) [#4](/projects/42648/tickets/4 "Ticket #4") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(1169): DboSource->fetchAssociated(Object(PackageType), 'SELECT `Package...', Array) [#5](/projects/42648/tickets/5 "Ticket #5") C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(1087): DboSource->queryAssociation(Object(PackageType), Object(Package), 'hasMany', 'Package', Array, Array, true, Array, 0, Array) [#6](/projects/42648/tickets/6 "Ticket #6") C:\wamp\www\lib\Cake\Model\Model.php(2653): DboSource->read(Object(PackageType), Array) [#7](/projects/42648/tickets/7 "Ticket #7") C:\wamp\www\app\Controller\AppController.php(36): Model->find('all') [#8](/projects/42648/tickets/8 "Ticket #8") C:\wamp\www\lib\Cake\Controller\CakeErrorController.php(71): AppController->beforeRender() [#9](/projects/42648/tickets/9 "Ticket #9") [internal function]: CakeErrorController->beforeRender(Object(CakeEvent)) [#10](/projects/42648/tickets/10 "Ticket #10") C:\wamp\www\lib\Cake\Event\CakeEventManager.php(246): call_user_func(Array, Object(CakeEvent)) [#11](/projects/42648/tickets/11 "Ticket #11") C:\wamp\www\lib\Cake\Controller\Controller.php(924): CakeEventManager->dispatch(Object(CakeEvent)) [#12](/projects/42648/tickets/12 "Ticket #12") C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(285): Controller->render('error500') [#13](/projects/42648/tickets/13 "Ticket #13") C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(267): ExceptionRenderer->_outputMessageSafe('error500') [#14](/projects/42648/tickets/14 "Ticket #14") C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(252): ExceptionRenderer->_outputMessage('pdo_error') [#15](/projects/42648/tickets/15 "Ticket #15") [internal function]: ExceptionRenderer->pdoError(Object(PDOException)) [#16](/projects/42648/tickets/16 "Ticket #16") C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(165): call_user_func_array(Array, Array) [#17](/projects/42648/tickets/17 "Ticket #17") C:\wamp\www\lib\Cake\Error\ErrorHandler.php(127): ExceptionRenderer->render() [#18](/projects/42648/tickets/18 "Ticket #18") [internal function]: ErrorHandler::handleException(Object(PDOException)) [#19](/projects/42648/tickets/19 "Ticket #19") {main} [CORE\Cake\Error\ErrorHandler.php, line 136] -- 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment