July, 2017
Archive

By In Magento 2

White page issue – Magento 2

Another very common issue in Magento 2 are white pages in back end, error that I resolved was related to Credit Memo functionality but similar method can be applied to similar issues as well.

To describe issue a bit more, I went to Sales > Order Management > Orders and selected order that should be refunded. Issue was found on several orders and they were made using Authorize.net or PayPal payment), so I excluded possibility that custom payment method could cause issue.

In order screen I clicked Credit Memo button and landed on white page without any error message or notification. Since there were no errors in browser console (wanted to check for java script errors), I checked var/log/systemlog file and found error log:

main.CRITICAL: Broken reference: No element found with ID ‘before.body.end’.

After checking few topics about issue and suggested solutions I decided to try simplest one, to update XML file and add missing layout parameter.

For the sake of test I deiced to edit core file at line #8:

html/vendor/magento/module-sales/view/adminhtml/layout/sales_creditmemo_index.xml

and changed original code:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

to:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
After that change I was able to open all test orders and perform Credit Memo without any issues, also there were no errors in log files.
To prevent change to be deleted on next Magento update I suggest that you overwrite core layout file with your own.
Magento 2 devdocs provide solid guide how to do that:

Read more