Docker is widely used for WEB development. However on Mac running such a heavy application as Magento 2 in Docker is not very smooth. Because Docker runs on Linux much better I tried setup everything on remote Ubuntu machine and have only IDE on Mac. In this article I would like to share my experience with configuring xDebug on such setup.
Continue reading “Configure xDebug on remote docker container”Update validation rule for customer address attribute in Magento 2
Validation rules for customer address attributes are stored in customer_eav_attribute table. Below is example of how to adjust a rule for specific attribute. Let’s say we want first name to be minimum 3 chars long. It is done via data patch.
Continue reading “Update validation rule for customer address attribute in Magento 2”How to debug Magento 2 MySQL (SQLSTATE) errors
Sometimes it is not easy to figure out where the database related errors come from. Error is usually being written to exception.log by Magento\Framework\DB\Statement\Pdo\Mysql class. But error message is not giving you idea what exactly caused the error. Below is the trick to get more info about error.
Continue reading “How to debug Magento 2 MySQL (SQLSTATE) errors”Class “Yandex\Allure\Adapter\AllureAdapter” does not exist – error in Magento
If the error above happens when you run integration, unit or api-functional tests the first thing to check is your phpunit.xml configuration file.
Make sure to pull the latest changes from Magento repository and compare your phpunit.xml vs phpunit.xml.dist, phpunit_graphql.xml vs phpunit_graphql.xml.dist, etc
Magento 2 customizable options – allow any file upload via Rest API
Magento 2 custom options allows you to add file upload option to product. So on frontend customer is able to attach a file to product when placing an order.
Recently I have discovered that it is not possible to upload file other than image via Rest API. In the code below I suggest a sample Plugin code that allows you to overcome this restriction.
Continue reading “Magento 2 customizable options – allow any file upload via Rest API”Download Magento 2.4.2 clean database dump
A clean Magento database may be needed for different cases. For example when you start with integration tests you will need a test Database. Or if you just want to reset Magento installation use the link below to download a Database dump.
Magento 2 dependent fields in UI component form
There are numerous tutorials about how to make one field dependent on other field value in UI Form. Many of them tells you to write some JS logic. However in most cases it is enough to add switcherConfig
to form declaration xml.
Add image upload field to Magento 2 UI component form
This post is about adding image upload field/attribute to Admin CMS page.
Continue reading “Add image upload field to Magento 2 UI component form”Magento 2 – Reset Expired Admin Password
It is always a good practice to change your password from time to time. Magento 2 will remind you to do it or even force you to do it if you haven’t updated appropriate settings in configuration:
However if it is Dev website it could be not such necessary to update password. Continue reading “Magento 2 – Reset Expired Admin Password”
Debugging PHP app using Xdebug and Remote Docker PHP Container
No so long ago I’ve started using Docker as my primary development environment. Before that I had everything (WEB-server, PHP, MySql, etc) installed on my Mac and being run natively. Docker brings more flexibility and it is just fun. So now my setup includes Mac OS with PhpStorm installed and remote Ubuntu server running Docker containers needed for my WEB application.
Continue reading “Debugging PHP app using Xdebug and Remote Docker PHP Container”