Actions
Bug #21249
closedindexed search Unset Stopwords in Backend is not possible
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-10-12
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
Unsetting Stopwords in Info->Indexed Search [Detail Page View] is not possible.
If you just set one Word, save, uncheck and save again you will get this message:
"Invalid argument supplied for foreach() in /var/www/www/kbgk/2009/data/typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php on line 1345"
If you set and unset more words you doenst get any error, but every unchecked word is still checked.
A little Workaround for function processStopWords:
/** * Setting / Unsetting stopwords * * @param array Array of stop-words WIDs with 0/1 to set / unset * @return void */ function processStopWords($stopWords, $phash) { if ($GLOBALS['BE_USER']->isAdmin()) { // Traverse words // Finding all words for this phash: $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( 'index_words.*, index_rel.*', 'index_rel, index_words', 'index_rel.phash = '.intval($phash). ' AND index_words.wid = index_rel.wid', '', 'index_words.baseword', '' ); foreach ($ftrows as $_ftrow_num => $_ftrow) { if ((int)$stopWords[$_ftrow['wid']] != $_ftrow['is_stopword']) { $changed_stopwords[] = array('is_stopword' => (int)$stopWords[$_ftrow['wid']], 'wid' => $_ftrow['wid']); } } foreach ($changed_stopwords as $_stopwords) { $fieldArray = array( 'is_stopword' => $_stopwords['is_stopword'], ); $GLOBALS['TYPO3_DB']->exec_UPDATEquery('index_words', 'wid=' . $_stopwords['wid'], $fieldArray); } } }
Are Stopwords allready in use, or is it not implemented yet?
(sorry for bad english).
(issue imported from #M12203)
Actions