简体   繁体   中英

Same code in 2.3 is not working with Magento 2.3.3 version

This is code was working fine with Magento 2.3 but 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. 在此处输入图片说明

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

如果您将其更改为:

$return = ' data-id=\'exampleid_p1\'';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM