[TYPO3-Solr] Using tx_solr_viewhelper_AbstractSubpartViewHelper

Ingo Renner ingo at typo3.org
Mon Dec 12 11:18:37 CET 2011


Am 28.10.11 11:28, schrieb Heiko Kromm | Paints:

Hello Heiko,

> with the templates I made a mistake. I will get the correct subpart. 
> The problem is, that you can't add a simple value to a variable like this: 
> $template->addVariable('mytest', 'Testcontent'); 
> You have to submit an array like this: 
> $template->addVariable('mytest', array('var1'=>'Test','var2'=>'Test2')); 
> 
> This is because of the getVariableMarkers method in tx_solr_template. 
> There is a preg_match_all, which only allows markers of the kind <marker>.<subvalue>. 
> preg_match_all( 
> '!###(' . $variableMarker . '\.[A-Z0-9_-]*)\###!is', 
> $subpart, 
> $match 
> ); 
> $markers = array_unique($match[1]); 
> 
> I think there should be a different regexp or a hint on the addVariable method. 

Getting back to this issue a bit late, but from the description of the
addVariable() method I have to agree. I guess this just got lost while
implementing these things.

Can you file an issue on forge please so that it doesn't get lost? Looks
like it could be solved easily.

Thanks for digging into this and providing the detailed analysis!


best
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code

TYPO3 - Open Source Enterprise Content Management System
http://typo3.org

Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com


More information about the TYPO3-project-solr mailing list