3

This is code was working fine with Magento 2.3, but is not with 2.3.3

Data.php

<?php
namespace Namespace\Module\Plugin\Search\Helper;
use Magento\Search\Model\QueryFactory;

class Data {

    protected $dataHelper;

    protected $view;

    public function __construct(
        \Namespace\Module\Helper\Data $helper,
        \Magento\Framework\App\View $view
    ) {
        $this->dataHelper = $helper;
        $this->view = $view;
    }

    public function afterGetEscapedQueryText(
        \Magento\Search\Helper\Data $subject,
        $result
    ) {
        $return = '';
        if(QueryFactory::QUERY_VAR_NAME == "q") {  
            $return = " data-id='exampleid_p1'";
        }

        return $result . $return;
    }
}

Screenshot of Frontend issue. enter image description here

What has been changed in Magento 2.3.3 that I started facing this issue?

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 1
    Are you sure this was working for `2.3`. The name of the function `afterGetEscapedQueryText` implies that it should be used like a *filter* for *escaped query text* which I believe is the `value` of the input. Is this filter function documented to actually see it's behavior? – Christos Lytras Mar 23 '20 at 00:12
  • Yes, working fine for 2.3 version. No documentation of this function. – PRASHANT BADERIYA Mar 23 '20 at 07:06

1 Answers1

2

Will it help if you change it to:

$return = ' data-id=\'exampleid_p1\'';
Ron
  • 5,900
  • 2
  • 20
  • 30