Halloween Sale - 15% OFF on any Magento 2 Extensions. Use Coupon code TrickOrTreat

Monthly Archives: September 2020

  1. How to debug 301/302 redirect in Magento 2?

    If you face an unexpected 301 or 302 redirect in Magento 2 and you don't know why it happens or what code causes it, you can easily find this out by temporarily editing the following files:

    /vendor/magento/framework/HTTP/PhpEnvironment/Response.php
    /var/www/html/m2_35ee/vendor/magento/framework/Controller/Result/Redirect.php

    Open Response.php and add the following line to the beginning of the setRedirect function:

    var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit();

    Example:

    public function setRedirect($url, $code = 302)
    {
        var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit();
        $this->setHeader('Location', $url, true)
            ->setHttpResponseCode($code);
    Read more »
  2. Uninstalling Magento 2 Product Grid Inline Editor

    If you decided to remove Magento 2 Product Grid Inline Editor by Magefan, please follow the steps below, also you can contact our team for a free consultation in case you have any issues with Magefan's extension.

    Remove Extension Files

    Removing files instruction depends on a way the product grid inline editor has been installed.

    1. If you can find the extension files in the folder

    app/code/Magefan/ProductGridInline

    then remove this folder.

    2. If the extension was installed via the composer and its files are located in the folder

    vendor/magefan/module-product-grid-inline

    then run composer CLI command to remove it

    composer remove magefan/module-product-grid-inline

    Read more »
  3. Updating Magefan Product Grid Inline Editor

    If you need to update Magento 2 Product Grid Inline Editor by Magefan, please follow the steps below. Note that the update instructions depend on the method product grid inline editor was installed with.

    Update using composer (Method 1)

    If the product grid inline editor was installed via the composer (check if vendor/magefan/module-product-grid-inline folder exists), then you need to run these simple CLI commands in Magento 2 directory:

    composer remove magefan/module-product-grid-inline
    composer require magefan/module-product-grid-inline ^x.x.x
    # replace x.x.x with the version you want to use
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy

     

    Read more »
  4. Magento 2 Product Grid Inline Editor Installation

    To install Magento 2 Product Grid Inline Editor by Magefan, please use one of these installation methods.

    Installation Method 1 - Installing via Composer (Recommended/Easier)

    Please navigate to your Magefan Account > My Downloads > Install via Composer to get the composer installation instructions.

    Read more »
  5. Debugging PHP Infinite loop in Magento 2

    There are situations in Magento 2 when page keeps loading and then you get 500 fatal error, memory limit, or timeout error. This is an infinite loop in the PHP code, when the same code is executed over and over again. It is related to some core Magento issues or, most likely, third party extension.

    To debug an infinite loop and find the loop entrance, please follow the steps below:

    1. Open the app/bootstrap.php file and add this code right after PHP open tag <?php in the next line

    $_SERVER['MAGE_PROFILER'] = 'html';

    2. Open the vendor/magento/framework/Profiler.php file and add this code to the beginning of "public static function start($timerName, array $tags = null)" function, e.g.

    Read more »
  6. Debug Backtrace in Magento 2

    In case you work with a lot of different Magento instances as a temporary project you might want to have a nice method to check debug backtrace of some function execution in Magento 2 quickly without installing or enabling additional software on the server, e.g. Xdebug.

    In this case, you can use the native Magento backtrace function from \Magento\Framework\Debug class and call it whenever you need:

    \Magento\Framework\Debug::backtrace(false, true, false);

    As a result, you will get this nice HTML debug-backtrace:

    Magento 2 Debug Backtrace

    Read more »
^Top
Chat