View Single Post
  #5  
Old 07-13-2018, 07:14 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Extending Tags Module without Breaking Search

Hi @xgarb,

Perfect, seems like the mod is almost complete!
I do not think you need this 'moreThan10' condition though.

This error seems to be caused by a bug. The addTranslationJoins() method should have used linkLeft() method instead of leftJoin() one. I will report that.

As a workaround solution, try to add the following method to your \XLite\Module\XCExample\SearchRepoDemo\Model\Repo\ Product class

PHP Code:
protected function addTranslationJoins($queryBuilder$alias$translationsAlias$code)
    {
        
$queryBuilder->linkLeft(
            
$alias '.translations',
            
$translationsAlias
        
);

        return 
$queryBuilder;
    } 

Please, let me know if it fixes the problem.

Tony


Quote:
Originally Posted by xgarb
I have the following error:

[Semantical Error] line 0, col 314 near 'tt WHERE p.enabled': Error: 'tt' is already defined.

from this code

PHP Code:
protected function prepareCndSubstring(\Doctrine\ORM\QueryBuilder $queryBuilder$value)
    {
        
$queryBuilder->linkLeft('p.tags''t');
        
$this->addTranslationJoins($queryBuilder't''tt'$this->getTranslationCode());

        
parent::prepareCndSubstring($queryBuilder$value);
    } 

in this file: XLite\Module\XC\ProductTags\Model\Repo\Product

I'm not sure what to do to stop the querybuilder adding the code in ProductTags repo?

T
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote