Author: David Lambauer

  • Workaround for Magento 2 Issue #5418 – Product Grid does not work after Import

    Workaround for Magento 2 Issue #5418 – Product Grid does not work after Import

    The Magento 2 Importer is a simple way to import and update Product Data and many more. Since July 2016, an Import will throw an Exception at the Product Grid. Today, I added a small script as a Workaround, which I want to share.

    It is actually simple and based on the Yonn-Trimoreau‘s SQL Query. I setup a bashscript, which enters the working dir and executes the query via n98-magerun2. After that, I added a CronJob to call the Script every Minute(In case someone starts the Import manually).

    This is the Bash Script:

    #!/usr/bin/env bash
    cd to/your/working/dir/ && /usr/local/bin/n98-magerun2.phar db:query 'DELETE FROM cataloginventory_stock_item WHERE product_id IN ( SELECT * FROM( SELECT product_id FROM cataloginventory_stock_item GROUP BY product_id HAVING COUNT( product_id ) >1 )tblTMP WHERE website_id = 1 )'

    My CronJob Configuration looks like this:

    # Job 1 by David Lambauer <d.lambauer@netz98.de>
    # This is a little Workaround for the following Magneto 2 Issue:
    # https://github.com/magento/magento2/issues/5418
    # This should be removed after the fix was applied.
    * * * * * www-data /path/to/your/bash/script/magento2-issue-workarround.sh

    It is pretty dirty, but it’ll work until Magento applied a Fix.

     

     

  • A Multi Factor Authentication Quickstart

    In the last couple of months, I started to dig deep into web security. I wanted to figure out, how the “dark side” works and how a hacker will act when he decided to penetrate my web application. So I downloaded a Kali Linux System, installed it on a virtual machine and started “hacking”…

    (more…)

  • Thoughts about custom attributes and the way to manage them!

    To add or update an EAV attribute in Magento, it is necessary to add setup scripts to your code base. If you don’t handle your custom attributes in setup scripts, you are not able to install your project from scratch, which could cause a lot of problems. For example, it makes it harder to run unit- and integration tests.

    So lets assume that we are working in a team with 4 developers and everybody has a different task. Each task needs a custom attribute in a different entity_type.

    I want to share my thoughts and summarize an overview of how the 4 developers could implement their setup scripts. Also, I want to show the advantages and disadvantages of each method.

    (more…)