[TYPO3-core] RFC: Fix (part of) #7589: FULLTEXT keys are not processed correctly

Dmitry Dulepov [typo3] dmitry at typo3.org
Thu Feb 28 12:35:17 CET 2008


Hi!

Michael Stucki wrote:
> Problem:
> If any table includes FULLTEXT key, that key will not be processed
> correctly. Both EM and instal tool will prompt to add key permanently even
> if key exists.
> 
> Solution:
> No solution yet. This patch is doing some cleanup first. I have already
> written the actual solution, but it would be hard to review it if it were
> mixed with these non-functional changes.
> 
> However, since I've run into trouble last time committing non-functional
> changes, I will first post it here to be sure.

Small comments :)

I would do one thing differently:

-$parts[1] = preg_replace('/([^ ]+)[ ]+([^ ]+)/', '$1 $2', $parts[1]);
+$parts[1] = str_replace('  ', ' ', $parts[1]);

$parts[1] = preg_replace('/ {2,}/', ' ', $parts[1]);

It takes care of three spaces. I am not sure of str_replace does. But I do not insist on this change.

Another thing: are you sure this is correct:
-$key = str_replace('`', '', $parts[0]);
+// Field definition
+$key = $parts[0];
 $total[$table]['fields'][$key] = $parts[1];

You keep backticks around field name. Same thing several line below in the patch. Not sure if it is a problem. Likely not.

Otherwise looks ok to me. +1.

-- 
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"


More information about the TYPO3-team-core mailing list