[TYPO3-dam] tx_dam_db::setPid
Thomas Maroschik
tmaroschik at dfau.de
Mon Aug 9 20:08:20 CEST 2010
Good evening dear DAM Team,
today i just stumbled upon the lack of tx_dam_db to set the pid
manually. Attached you will find a little patch, that fixes this.
I have to index a lot of files into an own sysfolder. By calling the
following code from an scheduler task
$index = t3lib_div::makeInstance('tx_dam_indexing');
$index->init();
$index->setRunType('man');
$index->enableReindexing(2);
$index->indexFiles($newFiles, $this->galleryPid, NULL, array($this,
'metaCallbackFunc')));
I am struggeling with the problem, that formerly indexed files get not
reindexed but rather new indexed as new records. In the indexer you can
set an pid, but this pid won't get handed over in
tx_dam_indexing::indexFile to tx_dam::index_check that calls
tx_dam_db::getDataWhere.
The static var in tx_dam_db::getPid named static $pid gets initially set
by tx_dam::config_setValue in ext_localconf. This method is just an
alias for tx_dam_config::setValue. In tx_dam_config::setValue there is a
check for $GLOBALS['T3_VAR']['ext']['dam']['config']. But this isn't
set, so tx_dam_config::init gets called. In line 82 tx_dam_config there
is a check for $pid = tx_dam_db::getPid(). In this line
tx_dam_db::getPid gets called the first time and the static property
inside tx_dam_db::getPid isn't changeable anymore during runtime.
Hope this isn't just an issue for me. I would be happy to see this patch
getting into trunk :)
Greetings,
Tom
--
___________________________
Thomas Maroschik
DFAU
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: class.tx_dam_db-pidsetter.diff
URL: <http://lists.typo3.org/pipermail/typo3-project-dam/attachments/20100809/777e45c2/attachment.txt>
More information about the TYPO3-project-dam
mailing list