Questions tagged [interceptor]
The interceptor tag has no usage guidance.
63
questions
1
vote
1
answer
23
views
Plugin for Magento\Setup\Model\ConfigOptionsList::validate
Is it possible to make a plugin for Magento\Setup\Model\ConfigOptionsList::validate()?
This function checks the validity of connection to DB and since I am dynamically generating password for DB, I ...
0
votes
1
answer
154
views
Interceptor not exists issue when running setup:upgrade command in magento 2
When i run setup upgrade command i got the following error
Class "Vendor_Name\Subscription\Test\Command\DispatchEventOOSProduct\Interceptor" does not exist
I tried to remove the ...
0
votes
1
answer
167
views
Class Demo\Helloworld\Controller\Post\index\Interceptor does not exist
I am trying to get data from a database table, my code of Index.php
<?php
namespace Demo\Helloworld\Controller\Post;
class Index extends \Magento\Framework\App\Action\Action
{
protected $...
0
votes
0
answers
97
views
Class Interceptor error
I have developed a module that use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection
but when I call the method i get this error:
Error occurred when creating object: Oct\Oct\Helper\Search\...
0
votes
1
answer
289
views
There has been an error processing your request: "0":"Unable to serialize value. Error: Malformed UTF-8 characters, possibly incorrectly encoded"
I am attempting to set up my local environment for Magento. When I try to view the front end, I get the following error on the page:
There has been an error processing your request
Exception printing ...
1
vote
1
answer
349
views
About performance: Is better to use before and after plugin instead around always when possible?
About use of each kind of interceptor (plugin) was answered here:
Is it better to use solely around function instead of before+after combined?
But in Magento docs says:
Avoid using around method ...
0
votes
0
answers
104
views
Parameter type seems to be wrong type in preference
I made this two preferences
<preference for="Magento\Catalog\Block\Product\ProductList\Toolbar" type="Prj\Catalog\Block\Product\ProductList\Toolbar" />
<preference for=&...
2
votes
2
answers
338
views
Search Results not using the Product list interceptor class
I needed to make some changes to the product list in magento 2.
So I went with this approach.
Create a plugin on the Magento\Catalog\Block\Product\ListProduct::toHtml method and do my changes in ...
0
votes
0
answers
32
views
Deactivating and reactivating plugins on-the-fly
I am currently developing on a VM with a Ubuntu host machine - it is super slow.
I am currently trying to implement a plugin but the magento s:d:c command takes 6 minutes.
Within examples for Plugins ...
0
votes
1
answer
227
views
Magento showing errors in developer mode
I have enabled developer and it's showing me following errors :
1 exception(s):
Exception #0 (Exception): Notice: A non well formed numeric value encountered in /opt/bitnami/apps/magento/htdocs/app/...
2
votes
0
answers
39
views
Basic clarity on some magento default function
I had gone through a interview process. They fired some questions below which I don't know answers and couldn't find in google. The questions are below.
How to create a object and why we need to ...
0
votes
1
answer
100
views
Strip space from frontend search query
my task at my work is that i remove spaces from a frontend sku search (the one at top and the one after hitting enter).
All sku's are formatted like AB 100001234, regexe and so on is ready to go.
If ...
0
votes
1
answer
718
views
magento 2 product class extending caused Type Error occurred when creating object: Company\Module\Model\Catalog\Product\Interceptor
https://magenticians.com/override-model-magento-2/
I have followed the above tutorial to extend the Product class to show our custom compatible products with the product that the customer views. ...
0
votes
2
answers
398
views
Interceptor Plugin for Product Attributes
I'm trying to modify the "short_description" attribute using a plugin but I can't seem to get it to work across the whole website. I can do this on the product view page with the following but I don't ...
1
vote
1
answer
2k
views
Magento 2: Fatal Error: 'Uncaught Error: Call to undefined method setWebsiteId()
I had created a custom API for customer registration in Magento 2.3. I am checking that the weather the customer is already registered or not with below code.
$email = $this->request->getParam('...
2
votes
1
answer
1k
views
Plugin intercept before place order for PayPal method on Magento2
In my Magento2 instance, I created a Plugin interceptor for run custom validation before process the payment. Works for all payment methods but PayPal Express or PayPal Standard.
di.xml
<config ...
1
vote
1
answer
1k
views
Save cart through backend gives @return type error
I am trying to change some data on a cart through the backend programmatically, i have a grid with a few actions, if i execute the Approve or Reject action it will go to a GET url.
Admin Controller
&...
-1
votes
2
answers
4k
views
Magento 2 : Class interceptor does not exist [duplicate]
I have a simple module when I save data
then this error :
Magepow\Importexport\Controller\Adminhtml\Allimports\Save\Interceptor
does not exist [] []
here is save file
<?php
namespace ...
1
vote
5
answers
10k
views
Class interceptor does not exist magento 2
Class Vendor\Mymodule\Controller\Adminhtml\Allimports\Save\Interceptor does not exist
I have a custom form and when I save data this error message, how to fix it, except usage di: compile. Thank you.
3
votes
1
answer
5k
views
Type Error occurred when creating Interceptor after Updating to 2.3.2
After updating Magento from 2.1.6 to 2.3.2 and PHP from 5.6.30 to 7.2.20, now running into errors on page load.
Have a module called Inquiry, which consists of forms to request things, and there is a ...
0
votes
0
answers
134
views
Mass update doesnt work in Magento 2.3.2
I am using bulk action feature in admin, on catalog page when am trying to update attribute am getting below error
Got error 'PHP message: PHP Fatal error: Uncaught Error: Cannot
instantiate ...
0
votes
4
answers
1k
views
Wishlist ajax remove
I want to remove product from wishlist from a custom button on detail. I did a plugin for the Magento\Wishlist\Controller\Index\Remove.php with an aroundExecute but for some reason I can't load/create ...
3
votes
3
answers
5k
views
Magento 2.3 Type Error occurred when creating object: Magecomp\Imageclean\Model\ResourceModel\Imageclean\Grid\Collection\Interceptor
I am using under given module.
https://magecomp.com/magento-2-image-clean.html
Till Magento 2.3.1 it's working perfectly.
After upgrade to 2.3.2 it giving under given error:
Type Error occurred ...
27
votes
8
answers
90k
views
Magento-2:Class Magento\Framework\App\Http\Interceptor does not exist
Exception.log file Error:
{"exception":"[object] (ReflectionException(code: -1): Class
Magento\Framework\App\Http\Interceptor does not exist
4
votes
1
answer
430
views
How do I prevent interceptor classes from being generated so I can debug?
I'm using xdebug to set breakpoints in Magento Commerce, which is installed locally on Ubuntu. I have a breakpoint set in vendor/magento/framework/App/FrontController.php. However, that breakpoint ...
0
votes
0
answers
4k
views
before plugin parameter magento 2
I am writing a before plugin for below public method.
public function setup($user,$pass,$url = null){
$this->username = $user;
$this->password = $pass;
if ($url) {
...
1
vote
1
answer
337
views
Unable to get newly inserted Product's Id using After Plugin for Catalog Product save controller method
I have created interceptor for catalog product controller's save action
<type name="Magento\Catalog\Controller\Adminhtml\Product\Save">
<plugin name="ricky_catalog_save_product"
...
3
votes
3
answers
2k
views
interceptor not generate for \Magento\Catalog\Block\Product\ListProduct
I'm trying to create plugin for getProductPrice but \Magento\Catalog\Block\Product\ListProduct Block Class not generate Interceptor Class like Magento\Catalog\Block\Product\ListProduct\Interceptor.
...
0
votes
1
answer
155
views
Create an Interceptor/Observer to trigger action when specific page is loaded
I want to send info to third party services about the views on pages like cart, products, checkout, etc. This info is sent whenever someone visits the respective page or view. For example, when a ...
2
votes
1
answer
464
views
Compilation error due to final class Vault in Magento version before 2.2.0
I am writing a plugin on class Magento\Payment\Model\MethodInterface:
<type name=“Magento\Payment\Model\MethodInterface”>
<plugin name=“mageworx_ordereditor_change_title_print_order”
...
0
votes
1
answer
290
views
Where to place magento 2.2.x custom interceptor
I am trying to look for a proper document where it is clearly told about where to place my interceptor code for continuous programming
This document https://devdocs.magento.com/guides/v2.2/extension-...
0
votes
1
answer
962
views
Magento2 plugin/interceptor not working
I have following action:
http://localhost/admin/catalog/product_attribute/edit/attribute_id/135/key/…/
I would like to do some extra things with attribute after saving.
I have created and registered ...
2
votes
1
answer
797
views
Remove plugin (interceptor)
I want to prevent a certain plugin from loading, namely 'authorization' plugin in
module-quote/Model/GuestCartManagement/Plugin/Authorization.php.
What i tried to do is to comment lines in di.xml ...
1
vote
1
answer
907
views
plugin to stop redirecting to cart from checkout
In M2 if the user tries to go to the checkout without any items in their cart the Magento\Checkout\Controller\Index\Index::execute() function redirects them to the cart.
if (!$quote->hasItems() || ...
0
votes
1
answer
164
views
How to stop Interceptor class rewriting return annotations
Magento version: 2.2.3
I have a Block class with a method to fetch the designer associated with a product. It is annotated to return a model interface or null.
public function getDesigner(): ?...
0
votes
2
answers
719
views
Why is Magento 2 creating this Interceptor file?
I've been comparing two versions of a website I'm working on -- one is fine and the other has a broken layout -- and the main difference I've found between them is the following file:
generated/code/...
0
votes
0
answers
218
views
Interceptor error in Observer
vendor/magento/module-sales/etc/events.xml
<event name="sales_order_save_after">
<observer name="sales_order_save_after" instance="Magento\Sales\Observer\SalesOrderSaveAfter" />
</...
3
votes
1
answer
142
views
Is it better to use solely around function instead of before+after combined?
The codes below can achieve the same output:
Using solely around plugin
public function aroundXXX(
SomeClass $subject,
\Closure $proceed
){
beforeFunctions();
/*Perform XXX*/
$...
1
vote
1
answer
778
views
How to stop saving resource model and throw error messages inside _beforeSave function?
I have the following codes inside a custom resourceModel class:
protected function _beforeSave(
AbstractModel $object
)
{
//My operations
return parent::_beforeSave($object);
}
I added a ...
0
votes
1
answer
67
views
Problem with widgets in Magento 2.1.9
I'm getting the next message when I try to add a widget on a block;
Insert Widget...
There has been an error processing your request
Class Magento\Widget\Controller\Adminhtml\Widget\Index\...
1
vote
2
answers
414
views
Magento 2 - Select the interceptor/observer
I want to have products that not require to stay logged and other that need it. So i think the best way is set in the admin "Allow Guest Checkout = Yes" and when the client goes to the checkout and ...
4
votes
1
answer
3k
views
Magento 2 using around interceptor/plugin to modify exception message
In the Magento\Checkout\Model\PaymentInformationManagement::savePaymentInformationAndPlaceOrder() method all exceptions are caught and CouldNotSaveException is created with a generic message.
I ...
4
votes
2
answers
2k
views
Plugin, get original function parameters in after method
When creating plugin (http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html) is there a way to get original parameters in after method?
I'm not sure what i can find in the first ...
3
votes
1
answer
918
views
Where is Magento\Framework\App\FrontController\Interceptor?
I am learning magento 2.1 request flow.
I am stuck here:
$frontController = $this->_objectManager->get('Magento\Framework\App\FrontControllerInterface');
$result = $frontController->...
2
votes
1
answer
547
views
Magento 2 getProductCollection Interceptor everytime
I would like to intercept and modify a product collection every time it is used. However, I am having issues figuring out what functions to create a plugin for. I mostly understand Interceptors, ...
1
vote
0
answers
82
views
Has anybody used Plugins(Interceptors) for Magento 1 from SafeMage Team? [closed]
everybody!
Could anybody tell me if he use Plugins(Interceptors) from this team?
http://www.safemage.com/function-plugins-for-magento-1.html
It seems it is similar to the same functionality of ...
4
votes
2
answers
5k
views
Magento 2 : Use plugin / interceptor on abstract class
I am trying to create a plugin that fires after \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShipment\PrintAction::execute.
So I have my plugin setup in di.xml and an afterExecute() method, ...
1
vote
1
answer
393
views
Sharing data between interceptor (plugin) and block. How?
I want to use some data from intercepters in a block.
To start with I have attempted to use DI to inject a simple custom model but by logging I see that a instance is been used by the interceptor ...
2
votes
1
answer
4k
views
Interceptor error in Controller magento2
Vendor\Module\etc\di.xml
<preference for="Magento\CatalogSearch\Controller\Result\Index" type="Vendor\Module\Controller\Result\Index" />
Vendor\Module\Controller\Result\Index.php
namespace ...
2
votes
2
answers
336
views
Add same plugin to all public methods of a type
Is there any chance to add a plugin to all public methods of a type without writing a separate method for all of them?
I would like to use that to log method calls. The original method is always ...