-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doctrine form not working when table alias used #673
Comments
From [email protected] on March 22, 2010 12:48:22 I tried this simple query $ab = Doctrine_Core::getTable('Model_Addressbook') (Users and Countries are referenced as FK - userID and countryID in Addressbook) and the result is:
All three tables have a field 'name', but displayed is only 'name' from the last one If I change the order of innerJoins
Since there is no "describe table" in non executed queries and thus quite hard to get
Of course, PK is present and it is standard 'id'. And it is included in results. One of the solution might probably be to specify ALL the fields in the select part, There must be some much simpler solution. |
From [email protected] on April 05, 2010 15:44:14 |
From [email protected] on December 01, 2010 22:27:41 is there an update for this issue, because this is dring me nuts, Thanks for the support tronga |
From [email protected] on October 07, 2011 12:12:31 Even I am having same issue is there any updates for that issue. Thanks for the support. Ashish |
From [email protected] on October 07, 2011 13:46:13 I kinda solved this problem by writing my own Doctrine.php, based on solomonjames version. Step by step. :-) It worked with zfDatagrid version that was actual at that time. I'm not working in PHP any more, but maybe someone can use this. Feel free to use it as you wish. As I remember, it solved a lot of my issues. Best regards and happy PHP-ing, vlatko basic |
From [email protected] on February 23, 2012 09:50:02 #0 C:\Program Files (x86)\Zend\Apache2\htdocs\Principasol\library\Doctrine\Table.php(249): Doctrine_Table->initDefinition() #4 C:\Program Files (x86)\Zend\Apache2\htdocs\Principasol\library\Doctrine\Query\Where.php(76): Doctrine_Query->load('ct', false)I use the latest version of zfdatagrid (0.8) , zendF(1.11) to.ogn_nom is foreigen key of (ogn_id =>TOrganisation) in TContact my Doctrine.php code is the same in svn Thanks for the support. |
From [email protected] on February 24, 2012 20:39:24 |
From [email protected] on March 05, 2012 10:18:58 public function getRecord($table, array $condition)
|
From [email protected] on March 05, 2012 11:05:59 |
Original author: [email protected] (March 21, 2010 19:43:23)
Hi,
if source is defined as
$ab = Doctrine_Query::create()->from("Model_Addressbook");
form is displayed, but when source is defined with alias as
$ab = Doctrine_Query::create()->from("Model_Addressbook u");
form display fails with stack trace
#0 C:...\Doctrine\Doctrine\Table.php(249): Doctrine_Table->initDefinition()
#1 C:...\library\iVa\Doctrine\Table.php(16):
Doctrine_Table->__construct('u', Object(Doctrine_Connection_Mysql), true)
#2 C:...\Doctrine\Doctrine\Connection.php(1126):
iVa_Doctrine_Table->__construct('u', Object(Doctrine_Connection_Mysql), true)
#3 C:...\Doctrine\Doctrine\Query.php(1924): Doctrine_Connection->getTable('u')
#4 C:...\Doctrine\Doctrine\Query.php(1722): Doctrine_Query->loadRoot('u', 'u')
#5 C:...\Doctrine\Doctrine\Query\Where.php(76): Doctrine_Query->load('u',
false)
#6 C:...\Doctrine\Doctrine\Query\Condition.php(92):
Doctrine_Query_Where->load('u.id = ?')
#7 C:...\Doctrine\Doctrine\Query\Abstract.php(2077):
Doctrine_Query_Condition->parse('u.id = ?')
#8 C:...\Doctrine\Doctrine\Query.php(1156):
Doctrine_Query_Abstract->_processDqlQueryPart('where', Array)
#9 C:...\Doctrine\Doctrine\Query.php(1122):
Doctrine_Query->buildSqlQuery(true)
#10 C:...\Doctrine\Doctrine\Query\Abstract.php(958):
Doctrine_Query->getSqlQuery(Array)
#11 C:...\Doctrine\Doctrine\Query\Abstract.php(1026):
Doctrine_Query_Abstract->_execute(Array)
#12 C:...\Doctrine\Doctrine\Query.php(267):
Doctrine_Query_Abstract->execute(Array, 3)
#13 C:...\Bvb\Grid\Source\Doctrine.php(150):
Doctrine_Query->fetchArray(Array, 5)
#14 C:...\Bvb\Grid\Deploy\Table.php(330):
Bvb_Grid_Source_Doctrine->getRecord('addressbook', Array)
#15 C:...\Bvb\Grid\Deploy\Table.php(1230):
Bvb_Grid_Deploy_Table->_processForm()
#16
C:...\application\modules\default\controllers\IndexController.php(123):
Bvb_Grid_Deploy_Table->deploy()
As I figured out it is the following (at #14 above):
a. table -> addressbook
b. condition -> u.id = 11
and here it fails.
Please insert the appropriate values;
Zend Framework version: 1.10.1
ZFDatgrid Version (Bvb_Grid::getVersion()): 0.6
Operating system:
PHP Version:
Database Server and version: MySQL 5.1.39
Source Adatapter: Doctrine
Please provide any additional information below.
Original issue: http://code.google.com/p/zfdatagrid/issues/detail?id=225
The text was updated successfully, but these errors were encountered: