[TYPO3-Solr] indexing problem with foldernames withblankincluded

Claus Fassing claus at fassing.eu
Fri Oct 14 09:12:49 CEST 2011


Hi Olivier,

Am 14.10.2011 00:14, schrieb Olivier Dobberkau:
> Am 13.10.11 22:38, schrieb Claus Fassing:
>
>> >  I'm using now a preUserFunc and this is working.
> can you share?

of course.

I append the function call (search context)
preUserFunc = user_quoteFileRelativePath->main
to typolink in case of url.

url = CASE
url {
   key.field = type

   tx_solr_file = TEXT
   tx_solr_file {
     typolink {
       preUserFunc = user_quoteFileRelativePath->main
       parameter.field = fileRelativePath
       returnLast = url
     }
   }

   default = TEXT
   default {
     field = url
     htmlSpecialChars = 1
     htmlSpecialChars.preserveEntities = 1
   }
}

The class with function :

class user_quoteFileRelativePath {
   function main($content, $conf) {
     $fileRelativePath = $this->cObj->data['fileRelativePath'];

     if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
       $currentLocale = setlocale(LC_CTYPE, 0);
       setlocale(LC_CTYPE, 
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']);
     }

     $fileRelativePath = escapeshellarg($fileRelativePath);

     if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
       setlocale(LC_CTYPE, $currentLocale);
     }

     $this->cObj->data['fileRelativePath'] = $fileRelativePath;

     return;
   }
}

Greetz Claus


More information about the TYPO3-project-solr mailing list