1

I have installed Magento 2.4.1, Frontend pages are working fine but while loading admin page it is throwing exceptions.

1 exception(s): Exception #0 (Exception): Warning: Magento\Framework\View\Element\Html\Calendar::_toHtml(): Cannot load resource element '0' in C:\xampp\htdocs\test\vendor\magento\framework\View\Element\Html\Calendar.php on line 114

I have tried running the following commands: bin/magneto setup:upgrade

bin/magneto setup:di:compile

bin/magneto setup:static-content:deploy

also tried clearing cache and re indexing etc.

Please guide me to fix this.

3
  • Hi, did you find a solution for this?
    – Shivani
    Jan 12 '21 at 14:15
  • @Shivani Yes, as I remember this is due to wrong php version. Please check and confirm if itworks for you. Feb 1 '21 at 6:26
  • This is happening for me in MAC. Also, I have the correct PHP version and INTL configured properly.
    – Shivani
    Feb 5 '21 at 7:31
0

Changing lines 114 and 115 to

    $this->assign('am', $this->encoder->encode($localeData['calendar']['gregorian']['AmPmMarkers'][0]));
    $this->assign('pm', $this->encoder->encode($localeData['calendar']['gregorian']['AmPmMarkers'][1]));

(i.e. removing the quotes around 0 and 1) solved the problem for me (on Magento 2.4.2 on Windows with intl ICU version 66.1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.