Tuesday, January 30, 2018

Magento 2 - Warning: Invalid argument supplied for foreach() in the file vendor/magento/module-config/Model/Config/Structure/Mapper/Sorting.php

Two ways to fix this issue.
  1. Fixing it by changing the line 96 in this file vendor/magento/module-config/Model/Config/Structure/Converter.php.
Actual Code: if ($children->length && trim($child->nodeValue, "\n ") === '') {
Corrected Code: if ($children->length && trim($child->nodeValue, "\n\t ") === '') {
  1. Check if the XML file has any tab spacing within it. If so, remove the tab spacing and replace them with normal single spaces.

Tuesday, December 12, 2017

Easy way to generate mod rewrites for .htaccess

Below is very useful tool for developers who want to play with  url rewrites. It converts the URLs to SEO friendly URLs. Using it in Magento is another thing :) you should be good enough in understanding URL structure and use it where it helps. Check it out.

http://www.generateit.net/mod-rewrite/index.php

Serialization of 'Magento\Framework\View\Layout\Element' is not allowed

It seems like a bug in Magento 2.1. EAV Attribute Cache mechanism is removed in Magento 2.2.0. Temporary solution will be disabling cache from backend or else we need to fix the module which is causing the issue which is not recommended way.

Link source: https://github.com/magento/magento2/issues/5339

Magento 2.2 commit link where the EAV cache mechanism is removed

https://github.com/magento/magento2/commit/3ae7c1909daad96d5a0ad6ab7048455448ba7480