Topic: Magento 2

Install and Upgrade Scripts in Magento 1.x Vs. 2.x 0

When we start writing Magento modules (in both versions 1.x or 2.x) sooner or later, we will need to change database schema and/or data. Magento provides a way to do this by using Install and Upgrade scripts. Using these scripts, we can

  1. Install or Upgrade the Database Schema
  2. Install or Upgrade data

In a self sustainable way while keep tracking of the changes done to the system.

File Resolving in Magento 2 (Static, Template, Script, …) : Clues for Debugging 0

When Magento 2 wants to find a view file from the filesystem, it uses a fallback mechanism with a file resolving method. Unlike when a Class file is missing (where it gives an error) sometimes Magento 2 doesn’t provide an error message or so (even if error display is enforced).

I came up with a typo in the filename, which I didn’t notice, I got empty content area on frontend. No error messages. After a few debug sessions, found some clues on few interesting places to look on such a scenario.

Installing and configuring Magento 2 on Window 7 0

Installing Magento 2 on Windows need some extra work since windows have some issues. Below video describes the step by step guide how to install Magento 2 on windows, what are the issues and how to fix those issues.
Install Magento 2
Creating new theme
Installing and configuring Grunt
Updating css

Magento 2 Module/Theme/Css/Js 0

Following video describes how to create M2 Module, Theme and how to add layout updates, css , js etc.

Magento 2 enable MySQL query logging 2

– In app/etc/di.xml file locate

<preference for="Magento\Framework\DB\LoggerInterface" type="Magento\Framework\DB\Logger\Quiet"/>

and change it to

<preference for="Magento\Framework\DB\LoggerInterface" type="Magento\Framework\DB\Logger\File"/>

– Pass constructor arguments like below. Check Magento\Framework\DB\Logger\File for more configuration options.

<type name="Magento\Framework\DB\Logger\File">
        <argument name="logAllQueries" xsi:type="boolean">true</argument>
        <argument name="debugFile" xsi:type="string">query.log</argument>

– Find log files under var directory