Last time we explored database access in Magento via creating simple Magento 2 CRUD objects, and we explored the various source files involved. While some of the window dressing has changed, Magento 1 developers probably felt right at home. Conceptually, Magento 1's Model/ResourceModel/Collection ORM
astorm
Sometimes, when you’re working with a Magento 2 command line script, you’ll see an uncaught exception that looks like the following. Area code not set: Area code must be set before starting a session Areas in Magento refer to different sections of an application (like frontend cart, or the adminhtml admin console) available [...]
astorm
If you’re being a good Magento 2 programmer, you’re not directly accessing an object manager instance. You’re using dependency injection to inject your objects in a constructor so future programmers will have a clear place to see a class’s dependencies, and change them if need be. But we know good programmers [...]
astorm
An Interesting Challenge for folks Using Magento 1 and PHP 7 Magento 1 doesn’t officially support PHP 7, but the changes needed to Magento’s core code to get this working aren’t too strenuous, and even third party extensions can be patched/modified to make this work. Whatever interesting here is the de-facto standard [...]
astorm
This one’s a follow up to my Magento 2: Understanding the Web API Architecture post. In that post I gloss over Magento’s oAuth implementation, and what I did say got several details wrong. This article aims to fix that. To understand Magento’s oAuth features, you need to understand the (related) integrations feature. To [...]
astorm
Magento 2 Feature Request: Simple, Standard, Seamless, PHP Install Option My thoughts on the state of Magento 2 from a product point of view, with a focus on why Magento needs to to shore up some PHP basics. Related to my open letter.
astorm
List Command not Wokring · Issue #121 · astorm/pestle Fixed the list command in pestle, my PHP command line framework/Magento code generation tool. Software is hard and often embarrassing.
astorm
First off, congratulations. It's been a heck of a year so far. Breaking away from eBay, the engineering release of Magento 2, and the coordinated launch of real businesses on your new platform. Most organizations would be lucky to pull off one of these
astorm
Another high level first pass at an important topic for Magento 2 developers. Corrections and clarifications are more than welcome. Magento 2, like Magento 1, has a “web” API. This has nothing to do with the @api notation on classes, methods, and interfaces. The Web API is a way for programmers to programmatically interact [...]
astorm
Another Shell Scripts for M2 Setup This time from Karen over at Web Shop Apps. It’s slower than we’d all like, but things are starting to consolidate around Magento 2 development.
astorm
Shell Script to Install Magento 2 Havne’t tried it yet, but this shell script purports to offer a simplified Magento 2 installer experience. Glad to see these sorts of things bubbling up to the surface.
astorm
Magento Travis Build Starter Travis is a popular, hosted system for automatically creating test environments for open source projects hosted on a GitHub. The word automatic can be a little misleading though – Travis hooks up to the GitHub API, handles spawning new virtual machines (presumably at AWS/EC2), and has a simple domain [...]
astorm
Removing a Block from Magento 2 Layouts I’ve dug into the Magento 2 layout enough to discover that On the PHP level, there are methods for removing/unsetting a block from the layout That these methods are not exposed via the Layout DSL
astorm
If you’ve read previous articles on the subject, you know that every URL in Magento 2 corresponds to a single controller file, and each controller file has a single execute method. This execute method is responsible for returning a “result” object (i.e. an object that implements the [...]
astorm
Thanks to Magento 2’s MVVM approach the traditional responsibilities of a controller object have been pushed into the “view model” layer (i.e. a block’s _prepareLayout method). The main job a controller performs in Magento 2 is to Determine what sort of response is needed (HTML page, JSON, Redirect) Create an [...]
astorm
Magento 2 validates most, if not all, of its XML configuration files via a schema document. If you’re dealing with someone else’s code and you need to jump to the source of a schema problems, here’s a debugging snippet. #File: vendor/magento/framework/Config/Dom.php public function validate($schemaFileName, &$errors [...]
astorm
This one's just a quick commercial interruption to let everyone know Pulse Storm has recently released Commerce Bug 3 for both Magento 1 and Magento 2 systems. Commerce Bug is a programmers debugging extension and in-browser IDE. The official press releases for the 3
astorm
A quick primer on running Magento 2’s development tests. Most of this is just reworded information from Vinai Kopp guiding me through. If you’re working with the Magento 2 GitHub repository, you can run the project’s unit tests with vendor/bin/phpunit -c dev/tests/unit/phpunit.xml This assumes you’ve copied [...]
astorm
PHP – Object equivalent of array_slice(); PHP’s built in interfaces for advanced object functionality remain a hidden feature of the language that too many developers don’t understand. In this Stack Exchange answer I outline the basics of how Magento 1 uses those interfaces for collection functionality, and why you [...]
astorm
I’m working on a few projects converting old Magento 1 extensions to Magento 2. One extension I was working on had a “frontend area checker” in an observer that would return early if the request didn’t happen on the frontend. Like any good refactoring programmer, rather than spend days trying to piece together why [...]
astorm