1

I have installed language extension and successfully installed on my test store. However, as soon as I have changed the admin language and press save, the admin page crashed, giving 500 error and cannot access at all. Frontend is still accessible.

I have deleted cache, but still not working.

I have contacted the developer, but if anyone has any idea how I could fix this, would be really appreciated.

EDIT:

Error Log:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /vendor/magento/framework/View/Element/Html/Calendar.php:86

4
  • Should enable error reporting: magento.stackexchange.com/a/152218/33057 Jan 7, 2017 at 16:04
  • Do you have access of server's error log? If yes could please share any error that is logged into log file. Jan 7, 2017 at 16:06
  • I enabled error reporting on bootstrap.php. But then what happens now? I tried accessing admin again, but don't see exception.log
    – user9839
    Jan 7, 2017 at 16:47
  • 1
    now I see at the root of Magento installation error_log and it says PHP Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /vendor/magento/framework/View/Element/Html/Calendar.php:86
    – user9839
    Jan 7, 2017 at 17:02

1 Answer 1

0

Again and again, for the unexpected 500 error, we should enable error reporting on the bootstrap. Should enable error reporting with -1 value. That will report all PHP errors.

Or need to check web server log.

app/bootstrap.php

ini_set('display_errors', -1) // Should enable error reporting with -1 value.

In your case, I'm not sure if it is a Magento bug or not. The locale Data may get the null value. Read more: https://github.com/magento/magento2/issues/5356

A temporary solution, go to this file: vendor/magento/framework/View/Element/Html/Calendar.php line ~65

Replace:

$localeData = (new DataBundle())->get($this->_localeResolver->getLocale());

With:

$localeData = (new DataBundle())->get('en_US');
2
  • Admin is working again! Thank you so much. Actually now the admin language is also the one I have changed to. Is it ok to keep the error reporting on the bootstrap enabled? Or only when 500 error occurs?
    – user9839
    Jan 8, 2017 at 6:13
  • @rtk0407 when 500, blank page, you should enable the error reporting to see more errors. From my experience, we should enable it when developing. Jan 8, 2017 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.