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.
astormWorkaround 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 [...]
astormWhen Magento 1 was initially released, "front end development" as it exists today was barely a thing. CSS was still largely written by hand, and jQuery vs. PrototypeJS was still a legitimate question for a new software project. Magento 2 enters a world where
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 [...]
astorm