Magento Certified Developer (Plus)

Posts By: Dilhan Maduranga

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

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

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.