pungpoo / giix

Automatically exported from code.google.com/p/giix
0 stars 0 forks source link

representingColumn() as related label as column produces error as checkbox #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create 3 tables "tbl_student", "tbl_adult_has_role",and "tbl_adult".
2. adultHasRole should have its own ID column, student_id (fk), adult_id(fk).
3. adultHasRole representing column 'adult' (the related table)
3. adult has id and first_name (representing column first_name).
4. student has id, and student_name
5. call 'index.php?r=student/create' and the checkbox generation fails.

What is the expected output?
Adult names from tbl_adult based on roles (yes can adults can have multiple 
roles as tbl_adult_has_role might have an array as representing column)

What do you see instead?
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not 
found: 1054 Unknown column 'adult' in 'field list'. The SQL statement executed 
was: SELECT id, adult FROM `tbl_adult_has_role` `t`.

What version of giix are you using?
1.9.1

What is your stack (operating system, web server, DBMS, PHP version)?
What version of the Yii Framework are you using?
Any relevant additional software (opcode cache etc)?
yii version 1.1.10
mysql
apache
tested on windows and linnux server

Please paste the stack trace and the error message.
2012/08/18 01:37:06 [error] [system.db.CDbCommand] CDbCommand::fetchAll() 
failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'adult' in 
'field list'. The SQL statement executed was: SELECT id, adult FROM 
`tbl_adult_has_role` `t`.
2012/08/18 01:37:06 [error] [exception.CDbException] exception 'CDbException' 
with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: 
Column not found: 1054 Unknown column 'adult' in 'field list'. The SQL 
statement executed was: SELECT id, adult FROM `tbl_adult_has_role` `t`' in 
F:\cygwin\home\project\web\framework\db\CDbCommand.php:528
#0 F:\cygwin\home\project\web\framework\db\CDbCommand.php(390): 
CDbCommand->queryInternal('fetchAll', Array, Array)
#1 F:\cygwin\home\project\web\framework\db\ar\CActiveRecord.php(1287): 
CDbCommand->queryAll()
#2 F:\cygwin\home\project\web\framework\db\ar\CActiveRecord.php(1406): 
CActiveRecord->query(Object(CDbCriteria), true)
#3 
F:\cygwin\home\project\web\protected\extensions\giix-components\GxActiveRecord.p
hp(254): CActiveRecord->findAll(Object(CDbCriteria))
#4 F:\cygwin\home\project\web\protected\views\student\_form.php(83): 
GxActiveRecord->findAllAttributes(NULL, true)
#5 F:\cygwin\home\project\web\framework\web\CBaseController.php(127): 
require('F:\cygwin\home\...')
#6 F:\cygwin\home\project\web\framework\web\CBaseController.php(96): 
CBaseController->renderInternal('F:\cygwin\home\...', Array, true)
#7 F:\cygwin\home\project\web\framework\web\CController.php(870): 
CBaseController->renderFile('F:\cygwin\home\...', Array, true)
#8 F:\cygwin\home\project\web\protected\views\student\create.php(19): 
CController->renderPartial('_form', Array)
#9 F:\cygwin\home\project\web\framework\web\CBaseController.php(127): 
require('F:\cygwin\home\...')
#10 F:\cygwin\home\project\web\framework\web\CBaseController.php(96): 
CBaseController->renderInternal('F:\cygwin\home\...', Array, true)
#11 F:\cygwin\home\project\web\framework\web\CController.php(870): 
CBaseController->renderFile('F:\cygwin\home\...', Array, true)
#12 F:\cygwin\home\project\web\framework\web\CController.php(783): 
CController->renderPartial('create', Array, true)
#13 F:\cygwin\home\project\web\protected\controllers\StudentController.php(70): 
CController->render('create', Array)
#14 F:\cygwin\home\project\web\framework\web\actions\CInlineAction.php(50): 
StudentController->actionCreate()
#15 F:\cygwin\home\project\web\framework\web\CController.php(309): 
CInlineAction->runWithParams(Array)
#16 F:\cygwin\home\project\web\framework\web\filters\CFilterChain.php(134): 
CController->runAction(Object(CInlineAction))
#17 F:\cygwin\home\project\web\framework\web\filters\CFilter.php(41): 
CFilterChain->run()
#18 F:\cygwin\home\project\web\framework\web\CController.php(1146): 
CFilter->filter(Object(CFilterChain))
#19 F:\cygwin\home\project\web\framework\web\filters\CInlineFilter.php(59): 
CController->filterAccessControl(Object(CFilterChain))
#20 F:\cygwin\home\project\web\framework\web\filters\CFilterChain.php(131): 
CInlineFilter->filter(Object(CFilterChain))
#21 F:\cygwin\home\project\web\framework\web\CController.php(292): 
CFilterChain->run()
#22 F:\cygwin\home\project\web\framework\web\CController.php(266): 
CController->runActionWithFilters(Object(CInlineAction), Array)
#23 F:\cygwin\home\project\web\framework\web\CWebApplication.php(276): 
CController->run('create')
#24 F:\cygwin\home\project\web\framework\web\CWebApplication.php(135): 
CWebApplication->runController('student/create')
#25 F:\cygwin\home\project\web\framework\base\CApplication.php(162): 
CWebApplication->processRequest()
#26 F:\cygwin\home\project\web\index-test.php(15): CApplication->run()
#27 {main}

Please attach your relevant source and configuration files and sql scripts.
Rather not do this step publicly.  Any db will do, can privately transmit 
migration files (but you'd have to generate your own test data) the migrations 
I have are quite complicated.

Please provide any additional information below.
This seems related possibly: 
http://code.google.com/p/giix/issues/detail?id=43&colspec=Stars%20ID%20Type%20St
atus%20Priority%20Milestone%20Owner%20Summary%20Reporter

representingColumn() 'adult' works great in adult/view&id=<ID> and 
student/view&id=<ID> under heading adult has roles view.  Major error when 
creating or updating.
Have any suggestions in the meantime?

Original issue reported on code.google.com by cpierc...@gmail.com on 18 Aug 2012 at 12:00