MantisBT - TestLink
View Issue Details
0008851TestLinkKeywordspublic2020-01-21 15:092020-01-21 20:39
atisne 
fman 
normalminoralways
resolvedfixed 
1.9.20_fixed 
1.9.20_fixed 
Mysql / Postgresql
Firefox
PHP 7
READY FOR TESTING
0008851: Create and Link an existing keywork fails with a DB error
Reproduced on Testlink 1.9.20 (github source @2020-01-21)

On a Test Case, if we use the action 'Create and Link' keyword, using an already existing keyword, the function fails displaying a DB error (see addition information).
1- Create a keyword
2- Edit a Test Case
3- Create and Link a keyword using the same label used in step 1
-> DB error
#0 database->exec_query() called at [/opt/testlink/lib/functions/testcase.class.php:3361]
#1 testcase->addKeywords() called at [/opt/testlink/lib/keywords/keywordsEdit.php:273]
0000002 do_cfl() called at [/opt/testlink/lib/keywords/keywordsEdit.php:45]

2020-01-20 09:13:38.350 CET [30962] testlink ERROR: insert or update on table "tltestcase_keywords" violates foreign key constraint "tltestcase_keywords_keyword_id_fkey"
2020-01-20 09:13:38.350 CET [30962] testlink DETAIL: Key (keyword_id)=(-1) is not present in table "tlkeywords".
2020-01-20 09:13:38.350 CET [30962] testlink STATEMENT: /* Class:testcase - Method: addKeywords */ INSERT INTO tltestcase_keywords (testcase_id,tcversion_id,keyword_id) VALUES (715,716,-1)
No tags attached.
child of 0008846assigned fman Availables hot-fixes for 1.9.20 & How To get full fixed package from GitHub 
Issue History
2020-01-21 15:09atisneNew Issue
2020-01-21 15:16atisneNote Added: 0029441
2020-01-21 20:37fmanNote Added: 0029443
2020-01-21 20:37fmanRelationship addedchild of 0008846
2020-01-21 20:38fmanQA Team - Task Workflow Status => TBD
2020-01-21 20:38fmanProduct Version => 1.9.20_fixed
2020-01-21 20:38fmanFixed in Version => 1.9.20_fixed
2020-01-21 20:39fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2020-01-21 20:39fmanStatusnew => resolved
2020-01-21 20:39fmanResolutionopen => fixed
2020-01-21 20:39fmanAssigned To => fman

Notes
(0029441)
atisne   
2020-01-21 15:16   
Fix suggested https://github.com/TestLinkOpenSourceTRMS/testlink-code/pull/248 [^]
(0029443)
fman   
2020-01-21 20:37   
thanks for the analysis and proposal.
I've solved it in a different way.

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/570e5e7b5c4214c90c9aeaed4aff469ea2ccd9a9 [^]