When JErrorPage::render() instantiates the JDocumentError instance for the error page, it doesn't inject any attributes into the object the same as if it were instantiated through another path (i.e. the install app's loadDocument method). This means the JDocumentError doesn't have the correct language or direction data within it if checking $this->language or $this->direction as done in HTML templates.
This PR will inject the same attributes into the JDocumentError instance as if it were instantiated another way and if the language data is available (it may be possible to hit the error page before the JLanguage singleton is instantiated) we'll add that to the attributes array.
Testing Instructions
Set your template to Beez3 for the frontend or Hathor on the backend; the other templates try to grab these attributes out of the JDocument instance in JFactory so it's harder to test against them. Trigger an error page somehow, preferably with another language active. Pre-patch, note the incorrect attributes in the <html> tag. Post-patch, it should be correct if JLanguage has been instantiated before the error page has been triggered.
I have tested this item✅ successfully on 78499e2
works as described. tested with beez3
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11403.