Project

General

Profile

Actions

Bug #19621

closed

getTreeList causes duplicate entry sql error

Added by Franz Holzinger almost 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-11-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

cache_treelist.diff (543 Bytes) cache_treelist.diff Administrator Admin, 2009-10-03 20:08
9803_working.diff (1.51 KB) 9803_working.diff Administrator Admin, 2010-04-15 17:03

Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #22412: cache_treelist is out of dateClosedDmitry Dulepov2010-04-10

Actions
Related to TYPO3 Core - Bug #22483: tslib_cObj::getTreeList() incorrectly checks cache entriesClosedDmitry Dulepov2010-04-19

Actions
Related to TYPO3 Core - Bug #22467: Tree list cache does not recognize 'this' for 'pidInList'ClosedDmitry Dulepov2010-04-15

Actions
Related to TYPO3 Core - Bug #22468: Function tslib_cObj::getTreeList() inserts records with empty PKClosedDmitry Dulepov2010-04-15

Actions
Has duplicate TYPO3 Core - Bug #18253: Duplicate entry on cache_pagesection on reloading twiceClosedChristian Kuhn2008-02-19

Actions
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Christian Kuhn about 15 years ago

Attached a patch to fix this.

Actions #4

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?!?!

Actions #5

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.

Actions #6

Updated by Dmitry Dulepov over 14 years ago

Most likely this is solved as a result of #22483.

Actions #7

Updated by Christian Kuhn over 14 years ago

This was solved with #22483 / #22483 / #22483

Thanks Dmitry!

Actions

Also available in: Atom PDF