MantisBT - TestLink
View Issue Details
0007955TestLinkTest Project Managementpublic2017-05-30 11:432018-04-15 10:36
shavantha 
fman 
normalcrashalways
closedfixed 
1.9.16 (2016 Q4) 
1.9.17 (2018 Q1) 
Ver 14.14 Distrib 5.5.46,
firefox
PHP 5.5.9-1ubuntu4.19
READY FOR TESTING
0007955: when enabling/disabling requirement feautes Unknown column 'testprojects.id' in 'where clause
when I click on enable/disable option for requirement features under Test Project Management, testlink throws an error on UI

The logs print
================

[<<][592d57fe7d43f371003513][DEFAULT][/lib/project/projectEdit.php][17/May/30 11:31:10][17/May/30 11:31:10][took 0.0049210000000001 secs]
[>>][592d57fe7e8aa588389136][DEFAULT][/lib/project/projectEdit.php][17/May/30 11:31:10]
    [17/May/30 11:31:10][ERROR][v9feotppmodhvahe3t5dgov8q6][DATABASE]
        ERROR ON exec_query() - database.class.php
1054 - Unknown column 'testprojects.id' in 'where clause' - /* Class:testproject - Method: setOptions */ UPDATE TL_testprojects SET options = 'O:8:\"stdClass\":4:{s:19:\"requirementsEnabled\";i:1;s:19:\"testPriorityEnabled\";i:1;s:17:\"automationEnabled\";i:1;s:16:\"inventoryEnabled\";i:0;}' WHERE testprojects.id = 36840
THE MESSAGE : /* Class:testproject - Method: setOptions */ UPDATE TL_testprojects SET options = 'O:8:\"stdClass\":4:{s:19:\"requirementsEnabled\";i:1;s:19:\"testPriorityEnabled\";i:1;s:17:\"automationEnabled\";i:1;s:16:\"inventoryEnabled\";i:0;}' WHERE testprojects.id = 36840
Query failed: errorcode[1054]
    errormsg:Unknown column 'testprojects.id' in 'where clause'
[<<][592d57fe7e8aa588389136][DEFAULT][/lib/project/projectEdit.php][17/May/30 11:31:10][17/May/30 11:31:10][took 0.013747 secs]

steps
1.follow the migration steps from 1.9.15 to 1.9.16 using the db scripts

2.set the custom_config.inc.php to login as an LDAP user

3.click on the enable/disable (light bulb option)

Note:The UI shows the error as below:
================================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START

 ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)

            Having this additional Information could be useful for reporting

            issue to development TEAM.

 ==============================================================================

#0 database->exec_query(/* Class:testproject - Method: setOptions */ UPDATE TL_testprojects SET options = 'O:8:\"stdClass\":4:{s:19:\"requirementsEnabled\";i:0;s:19:\"testPriorityEnabled\";i:1;s:17:\"automationEnabled\";i:1;s:16:\"inventoryEnabled\";i:0;}' WHERE testprojects.id = 35718) called at [/var/www/html/testlink/lib/functions/testproject.class.php:3699]
#1 testproject->setOptions(35718, stdClass Object ([requirementsEnabled] => 0,[testPriorityEnabled] => 1,[automationEnabled] => 1,[inventoryEnabled] => 0)) called at [/var/www/html/testlink/lib/functions/testproject.class.php:3658]
0000002 testproject->disableRequirements(35718) called at [/var/www/html/testlink/lib/project/projectEdit.php:92]
=======================================================================
Preconditions
1.data should exist under Test Project Management option
No tags attached.
? testlink_logs (2,441) 2017-05-30 11:43
http://mantis.testlink.org/file_download.php?file_id=4726&type=bug
Issue History
2017-05-30 11:43shavanthaNew Issue
2017-05-30 11:43shavanthaFile Added: testlink_logs
2017-05-30 11:56shavanthaNote Added: 0026414
2017-05-30 19:04fmanNote Added: 0026417
2017-05-30 19:04fmanAssigned To => fman
2017-05-30 19:04fmanStatusnew => feedback
2017-05-31 04:56shavanthaNote Added: 0026418
2017-05-31 04:56shavanthaStatusfeedback => assigned
2017-05-31 17:07fmanQA Team - Task Workflow Status => READY FOR TESTING
2017-05-31 17:07fmanStatusassigned => resolved
2017-05-31 17:07fmanFixed in Version => 1.9.17 (2018 Q1)
2017-05-31 17:07fmanResolutionopen => fixed
2018-04-15 10:36fmanNote Added: 0027385
2018-04-15 10:36fmanStatusresolved => closed

Notes
(0026414)
shavantha   
2017-05-30 11:56   
I tested the same scenario on a fresh installation of 1.9.16 version of testlink and didnt come across this issue. But this issue comes on the setup which was migrated from 1.9.15 to 1.9.16
(0026417)
fman   
2017-05-30 19:04   
if you give a look to the query you will see that issue regards TABLE PREFIX.
on the offending SQL it seems you are using TL_ as table prefix.

try changing setOptions method :

" WHERE id = " . $safeID;

instead of

" WHERE testproject.id = " . $safeID;
(0026418)
shavantha   
2017-05-31 04:56   
thanks, the change helped to resolve the issue
(0027385)
fman   
2018-04-15 10:36   
released