Workaround for Magento 2 static asset/symlink bugs
Workaround for Magento 2 static asset/symlink bugs Hackish workaround for the problem of static asset generating and serving not working with symlink-ed modules.
astormBelow you'll find all the Uncategorized articles on the site, followed by a chronological listing of the same. You may also browse the 8 series directly via the following links. Miscellaneous Magento Articles, SugarCRM for PHP MVC Developers, Magento 2: Advanced Javascript, Magento 2 UI Components, Accelerated Mobile Pages, Pestle, Sylius for Magento and PHP Developers, and, Containers, Containers, Containers.
Workaround for Magento 2 static asset/symlink bugs Hackish workaround for the problem of static asset generating and serving not working with symlink-ed modules.
astormI did a quick review of Magento 2 questions I’ve asked on Stack Exchange recently. Most had answers, but there were still some that remained unanswered, or whose answers were incomplete. If you’re looking for something to do during your corporate by week tracking down answers to these would be a big help. Magento’s [...]
astormA quick word of warning – if you’re going to blow away the pub/static folder and regenerate your assets (either dynamically with in developer mode, or statically with setup:static-content:deploy) don’t forget to restore the .htaccess file at pub/static/.htaccess. Magento won’t be able to do its automatic developer [...]
astormOne of the interesting changes betweem Magento 2’s merchant beta and their official release was/is the registration.php file. Every module now needs this file at its root folder for Magento to identify it as a module. You can see the list of folders Magento scans for modules (i.e. registration.php) here #File: [...]
astormI’m seeing some behavior in Magento 2’s cookie management that has my “I’ve been at this too long” hackles raised. Different areas (adminhtml, frontend) still have separate session cookies, but the adminhtml area’s is named admin, and the frontend area’s uses the default PHPSESSID. It’s [...]
astormEarly Stage Plugins/Interceptors Don’t Work in Developer Mode · Issue #2674 · magento/magento2 This one was fun to track down. I was trying to plugin to Magento’s logger (MagentoFrameworkLoggerMonolog) but my plugin wasn’t working. Being new to Magento, I assumed the problem was an incorrect configuration, but [...]
astormIf you’re seeing the following error in Magento 2 Invalid Base URL. Value must be a URL or one of placeholders: {{base_url}} The problem may the lack of a trailing slash on your base URLs http://example.com vs. http://example.com/ There’s some questionable URL validation going on in #File: [...]
astormA quick code-point mention #File: app/code/Magento/Catalog/Model/Product/Image.php public function resize() { if ($this->getWidth() === null && $this->getHeight() === null) { return $this; } $this->getImageProcessor()->resize($this->_width, $this->_height); return $this; } This method is where Magento 2 will [...]
astormMagento 2, even community edition, comes with a “full page cache” out of the box. This caching system lives near the top of Magento’s application dispatch. The frontcontroller will skip action controller dispatch if it can find a cached version of the page. You can turn this feature off in the backend at System -> [...]
astormMagento 2: Adding Arbitrary HTML to the of Every Page? This developer tried to embrace the new <head/> and <body/> standards in Magento 2’s layout, and you won’t belive what happens next. Spoilers – what happens next is he learns the <head/> directive has no way to add arbitary HTML, but that adding [...]
astormThe error Parse error: syntax error, unexpected ’)’, expecting ’&’ or variable (T_VARIABLE) in is by far te most common thing I’m seeing during Magento 2 development. Its root cause? public function __construct( MagentoFrameworkAppRequestInterface $requestInterface, ) I’m injecting a dependency by [...]
astormeBayEnterprise/magento-log An interesting Magento 1 project that creates a PSR 1 wrapper for Magento 1 logging. Useful if there’s a tool/library out there expecting a PSR logging interface that you want to use with Magento 1.
astormI ran into this error Fatal error: Call to a member function getId() on a non-object in /path/to/magento/lib/internal/Magento/Framework/View/Model/Layout/Merge.php on line 745 after loading a new system’s MySQL database into my local development environment. Magento 2’s theme settings allow you to pick a specific theme from a [...]
astormMagento 2: Sending a Custom Header/Response from a Controller This one’s an interesting example of the challenges faced when refactoring legacy code, as well as the limitations of what a “classical OOP” approach can do for you in a PHP enviornment. First, this answer, while correct in the fact that it works, is not [...]
astormThis is quick, high level, possibly incorrect, overview of how Magento 2 runs applications, and what the kernel of its system architecture looks like. This is the level above MVC/MVVM, and will only be of interest to folks (like me) who need to know how everything works. From a high level point of view, Magento 2 is an abstract operating [...]
astormMagento 2: Serializing a Category Tree as Primitive Types
astormOne thing that keeps biting me in the trnasition from Magento 1 to Magento 2 is that sometimes the etc folder has an area hierarchy. For example, in Magento 1, you system configuration file (respoisble for building out a module’s configuratioin UI) lived in etc/system.xml In Magento 2 this file lives in etc/adminhtml/system.xml [...]
astormMagento 2: Serializing a Category Tree as Primitive Types Fence post towawrds understanding Magento’s Service Contracts. (Service Contracts underly the new API system)
astormmage-eag/mage-enhanced-admin-grids Interesting extension I stumbled upon during a consulting gig. Lets you — via a UI — add columns to many of Magento’s backed UI grids based on the fields avaiable in the collection.
astorm503 Service Temporarily Unavailable on Magento after Clearing Cache Some tips from me on debugging 503 errors in Magento.
astorm