Here’s a fun pestle command I forgot about. pestle.phar magento2:search:search_controllers This command accepts a file path as a single argument, searches through the specified folder for anything that looks like a Magento controller file, and then displays that controller file’s execute method along with its relative file [...]
astorm
This entry is part 3 of 12 in the series Pestle. Earlier posts include Pestle 1.1.1 Released, and Pestle 1.1.2 Released. Later posts include Pestle 1.2.1 Released, Sending Text Messages with PHP, pestle, and Nexmo, Pestle 1.3 and AbstractModel UI Generation, Pestle 1.4.1 and the Merits of Inheritance, Pestle 1.4.4 Released, Pestle Docs [...]
astorm
This entry is part 2 of 12 in the series Pestle. Earlier posts include Pestle 1.1.1 Released. Later posts include Magento 2 Setup Migration Scripts, Pestle 1.2.1 Released, Sending Text Messages with PHP, pestle, and Nexmo, Pestle 1.3 and AbstractModel UI Generation, Pestle 1.4.1 and the Merits of Inheritance, Pestle 1.4.4 Released, [...]
astorm
UI Component Item source Nodes are Redundant I finally got an answer out of Magento engineering on those <item name="source"/> nodes and their best guess is as good as ours. i.e., they’re redundant/not-used. There’s a few interesting points to make here for folks just learning to program, and just getting settled into [...]
astorm
Although there’s no documentation stating this, based on system behavior it seems like the Package/Module/Setup/InstallSchema.php class files are sort of required by a Magento module. I say sort of required because you can run a module without them. You can use that module to add features to Magento. However, a version number for [...]
astorm
This entry is part 1 of 12 in the series Pestle. Later posts include Pestle 1.1.2 Released, Magento 2 Setup Migration Scripts, Pestle 1.2.1 Released, Sending Text Messages with PHP, pestle, and Nexmo, Pestle 1.3 and AbstractModel UI Generation, Pestle 1.4.1 and the Merits of Inheritance, Pestle 1.4.4 Released, Pestle Docs Done (for now), [...]
astorm
While PHP production environments have long made use of extra systems like memcache, varnish, and redis, most successful PHP projects also let developers and technically savvy folks drop an archive of files on a server, point the web server at those files, configure the application to point to a traditional RDMS/database, and have a [...]
astorm
Tangentially Magento related: Magento uses the lusitanian/oauth composer package to handle some oAuth related tasks. In addition to the usual “create the cryptic Authorization: headers” code you’d expect to find in an oAuth library, there’s also these two folders of code [...]
astorm
In a typical adminhtml UI Form Component, each individual form element has a corresponding view model object. For text input fields, these view models come from the constructor function returned by the Magento_Ui/js/form/element/abstract RequireJS module. The view model’s value property, an Knockout observable object, contains the [...]
astorm
This entry is part 13 of 13 in the series Magento 2 UI Components. Earlier posts include Magento 2: Introducing UI Components, Magento 2: Simplest UI Component, Magento 2: Simplest UI Knockout Component, Magento 2: Simplest XSD Valid UI Component, Magento 2: ES6 Template Literals, Magento 2: uiClass Data Features, Magento 2: UI Component [...]
astorm
GitHub – DavidLambauer/awesome-magento2: Curated list of awesome Magento 2 Extensions, Resources and other Highlights I haven’t reviewed these, but a working developer’s take on what makes an “awesome” module is always worth investigating.
astorm
Keeping with UI Component form theme but drawing a wider circle, if you take a look at HTML source of a button on a backend Magento 2 HTML form, you’ll see something like the following <button id="back" title="Back" type="button" class="action- scalable back" onclick="location.href = [...]
astorm
Merged Layout schema validation error in Magento 2 A peek at the complexity deep in Magento 2’s layout rendering engine.
astorm
It surprised me that over a year after Magento 2’s introduction I haven’t had an opportunity to create a new form component using the UI Component system. In the extensions and themes I’ve helped folks port over it made a lot more sense to just convert the old PHP rendered HTML to the new extension. When time is money [...]
astorm
For backend UI Components, the rendered x-magento-init JSON argument contains two top level keys: types and components { "*": { "Magento_Ui/js/core/app": { "types": {/*...*/}, "components": {/*...*/} } } } The Magento_Ui/js/core/app module/application uses the data in components to instantiated a nested tree of uiClass based objets and [...]
astorm
mattwellss/magento-composer-autoloader For folks still playing “wait and see” with Magento 2, (i.e. most current Magento systems), and who are using some sort of Composer workflow (not most Magento 1 systems), this is a small autoloader optimization that fixes Magento 1’s selfish “if I try to load someone [...]
astorm
So, over the summer I covered how to invoke a function returning RequireJS modules via an x-magento-init script. Today I discovered there’s a syntax for doing this with an object returning RequireJS module. If you’ve got an x-magento-init that looks like this <script type="text/x-magento-init"> { "*": { [...]
astorm
One of the challenges Magento 2, (and all “full stack” oriented frameworks), face is data synchronization between the front end and the server. Server data will always represent the “source of truth” for any particular piece of data, but good front end developers will always be looking to reduce to number of round [...]
astorm
How to clear billing form validation errors when using Magento UI components A “quick” (har har) answer from me on how to reset a form field’s validation state in the Magento 2 checkout application. This is also a nice example of how, no matter how far we progress with computers doing things for us, it’s always [...]
astorm
A useful code snippet that came out of a discussion on the Patreon slack today. requirejs([ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/shipping-rate-registry' ], function(quote, rateRegistry){ //get address from quote observable var address = quote.shippingAddress(); //changes the object so observable sees it as [...]
astorm