Bug #19621
closedgetTreeList causes duplicate entry sql error
0%
Description
When the method getTreeList is called by an extension, then this causes duplicate entry message upon inserting into cache_treelist
You can check this by calling tslib_cObj->getTreeList.
It should have checked the value before inserting the same again.
function/mode Pg36 exec_INSERTquery(cache_treelist) - /var/www/html/typo3conf/ext/debug_mysql_db/class.ux_t3lib_db.php:127
$query INSERT INTO cache_treelist
(
md5hash,
pid,
treelist,
tstamp
) VALUES (
'ffa2bf410d43b065d8b19cb0eb012bf5',
'316',
'',
'1226997258'
)
ERROR = Duplicate entry 'ffa2bf410d43b065d8b19cb0eb012bf5' for key 1
lastBuiltQuery
debug_backtrace index.php#14154:require // index_ts.php#14154:include // pagegen.php#14154:TSpagegen::renderContent // class.tslib_pagegen.php#14154:tslib_cObj->cObjGet // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->TEMPLATE // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->COBJ_ARRAY // class.tslib_content.php#14154:tslib_cObj->cObjGet // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->CONTENT // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->CASEFUNC // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->COBJ_ARRAY // class.tslib_content.php#14154:tslib_cObj->cObjGet // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->CASEFUNC // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->CASEFUNC // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->cObjGetSingle // class.tslib_content.php#14154:tslib_cObj->USER // class.tslib_content.php#14154:tslib_cObj->callUserFunction // class.tslib_content.php#14154:call_user_func_array // #:tx_ttproducts_pi1->main // class.tx_ttproducts_pi1.php#14154:tx_ttproducts_pi1_base->main // class.tx_ttproducts_pi1_base.php#14154:tx_ttproducts_main->run // class.tx_ttproducts_main.php#14154:tx_ttproducts_control->doProcessing // class.tx_ttproducts_control.php#14154:tx_ttproducts_basket_view->getView // class.tx_ttproducts_basket_view.php#14154:tx_ttproducts_relatedlist_view->init // class.tx_ttproducts_relatedlist_view.php#14154:tx_ttproducts_pid_list->applyRecursive // class.tx_ttproducts_pid_list.php#14154:tslib_cObj->getTreeList // class.tslib_content.php#14154:ux_t3lib_DB->exec_INSERTquery // class.ux_t3lib_db.php#14154:ux_t3lib_DB->myDebug
(issue imported from #M9803)
Files
Updated by Christian Müller over 15 years ago
This bug is related to 0007591 in cause and effect but it seems to be in the extension "debug_mysql_db" not in CORE as stated and I can't find this extension in TER right now.
Updated by Christian Kuhn about 15 years ago
This is IMHO not related to #18253, but a bug in the cache implementation.
This happens if a page of which getTreeList is called doesn't have subpages.
Updated by Stefan Froemken almost 15 years ago
It must not be an extension. It also can be an mistake in TypoScript. I just get the same error on some pages when I have cleared the cache. After a page refresh the error disapears.
t3lib_DB::exec_INSERTquery
Duplicate entry '' for key 'PRIMARY'
INSERT INTO cache_treelist(md5hash,pid,treelist,tstamp) VALUES ('','0','','1263907139')
I found my mistake in following script:
10 = CONTENT
10 {
table = pages
select {
orderBy = title
pidInList = this
recursive = 1
selectFields = uid, title
}
renderObj = TEXT
renderObj {
...
}
}
"recursive" have to be 0 or this row has to be deleted completely. Don't ask me why I inserted this row...I don't know?!?!
Updated by Dmitry Dulepov over 14 years ago
I attach the alternative version of the patch. Please, do not use it yet because it is a working version for me. When #22468 is committed, I will make a full correct patch.
Updated by Dmitry Dulepov over 14 years ago
Most likely this is solved as a result of #22483.