Magento 2 Fixes

  1. Magento 2.3 - TinyMCE 4 Toolbar / Text Color Tool Missing

    In Magento 2.3 and greater, Magento team has changed WYSIWYG editor, instead of TinyMCE 3 Magento started use TinyMCE 4.

    On the picture below, you can see Magento 2.0-2.2 TinyMCE 3  editor:

    TinyMCE 3 Magento 2 Editor

    Default Magento TinyMCE 4 editor does not include a lot of tools for example text color or text background and this can be inconvenient for the content manager.

    Magento 2 TinyMCE 4

    Read more »
  2. Magento 2 Showing Wrong Customer IP

    Sometimes instead of the real customer IP address, you can see 127.0.0.1 or some other wrong customer IP in your Magento 2 Admin panel. It can be due to proxies, like Varnish, Cloudflare, that may be enabled for your Magento 2 store.

    To solve the wrong IP address issue you need to:

    1. Create a new file in M2 directory:

    app/etc/XIP/di.xml

    2. Paste the code:

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
    <arguments>
    <argument name="alternativeHeaders" xsi:type="array">
    <item name="x-client-ip" xsi:type="string">HTTP_X_REAL_IP</item>
                    <item name="x-cf-connecting-ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
         
    Read more »
  3. bin/magento Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate xxx bytes)

    When you run Magento 2 CLI command "bin/magento ..." and get the error:

    Allowed memory size of xxxx bytes exhausted (tried to allocate xxx bytes)

    You can easily fix it using instead of bin/magento this command:

    php -dmemory_limit=-1 bin/magento ....
    Read more »
  4. Fix: Module 'Company_Module' from 'app/code/Company/Module' has been already defined in 'vendor/company/module'.

    If you have installed or updated Magento 2 extension and received the error message e.g.:

    Module 'Company_Module' from 'app/code/Company/Module' has been already defined in 'vendor/company/module'.

    this means that you have 2 versions of the extension:

    1) in the folder app/code/Company/Module
    2) in the folder vendor/company/module

    In vendor folder Magento stores all components (extensions, themes, language packages) that have been installed using Composer.

    As installing or updating extensions via Composer is preferred, you need to remove extension folder app/code/Company/Module (please don't forget about a backup before removal) and run installation commands.

    Read more »
  5. No such entity - Fix for Magento 2

    If you receive the error message "No such entity.", "No such entity with" or "No such entity with customerId" in Magento 2, the issue usually occurred when you try to load not existing object via Magento 2 Repository Class.

    To debug this issue, please open the file

    vendor/magento/framework/Exception/NoSuchEntityException.php

    Read more »
  6. The following modules are outdated - Fix The Issue

    When you update Magento 2, Magento extension or switching git branches on your dev environment, sometimes you can get the error:

    The following modules are outdated: Vendor_Module schema: current version - x.x.x, required version - z.z.z 

    To solve this issue, please do next:

    1. Try to get the latest extension code. Run CLI command in the Magento root directory:

    composer install

    If you get troubles with running this command, then just skip it, and move to step 2.

    2. Try to upgrade your database. Run CLI command:

    php bin/magento setup:upgrade

    Read more »
  7. Magento 2.2.x layout pattern issue

    If you use Magento 2.2.x and get the error like:

    1 exception(s):
    Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Text\ListText' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'.
    Line: 1187
    Element 'block', attribute 'class': '\Magento\Framework\View\Element\Text\ListText' is not a valid value of the atomic type 'blockClassType'.
    Line: 1187

    Please find in all *.xml layout files string

    class="\

    and replace it with

    class="

    (Remove slash from the beginning of the class attribute value)

    Read more »
  8. bash: bin/magento: Permission denied

    Usually, you get the error bash permission denied when running some script/file that does not have execute permissions. All you need to do is to change file permissions and add executive one. To do this run the CLI command:

    chmod +x path_to_file/file_name

    For example, if you run a Magento 2 CLI command:

    bin/magento ...

    and get the error:

    bash: bin/magento: Permission denied

    You'll need to add an execute (x) permission to the bin/magento file.

    Read more »
  9. Fixing issue with missing color option on search results

    Please follow the instructions to fix the issue.

    1. Create new layout XML file in you theme

    app/design/frontend/Vendor/theme/Magento_Swatches/layout/catalogsearch_result_index.xml

    2. Put content

    <?xml version="1.0"?>
    <!--
    /**
     * Copyright © 2015 Magento. All rights reserved.
     * See COPYING.txt for license details.
     */
    -->
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" 
                    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
            <css src="Magento_Swatches::css/swatches.css"/>
        </head>
        <body>
            <referenceBlock name="category.product.type.details.renderers">
                <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable"
                                 template="Magento_Swatches::product/listing/renderer.phtml" />
            </referenceBlock>
        </body>
    </page>

    Read more »
^Top
Chat