?
avatar piotr-cz
piotr-cz
7 Sep 2016

Steps to reproduce the issue

  1. Install polish language
  2. Trigger error page
  3. Inspect document response Status code (in Chrome Inspect > Network > click on first item)

Expected result

404 Not Found

Actual result

404 Artyku%C5%82u nie znaleziono

System information (as much as possible)

Tested on Joomla v3.4.8 and v3.6.2

Additional comments

Actual translation is Artykułu nie znaleziono, but HTTP status messages are ASCII-only.

As @mbabker pointed out here,

The status code is using the Exception object's message, not a HTTP
standard message. So that's why.

There should be a map of status code: status message (at least for error codes used by Joomla) and JDocumentError should pick one here

Similar to how it's set in Slim\Http\Response

avatar piotr-cz piotr-cz - open - 7 Sep 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Sep 2016

@piotr-cz can you make a PR?

avatar piotr-cz
piotr-cz - comment - 7 Sep 2016

I'm not sure where to store the map. Should it be JErrorPage?

BTW: The HTTP reason phrase for 403 is Dost%C4%99p zabroniony

avatar mbabker
mbabker - comment - 7 Sep 2016

Make a Response object that has these mappings. To save some work, just grab the data out of Symfony's Response object. Now there's a valid map for all known standard codes.

You could easily throw it in JResponse; undeprecate the class (it was deprecated since we moved all of its existing logic to the web application class) and add the new logic there.

avatar piotr-cz
piotr-cz - comment - 7 Sep 2016

Shouldn't the map go to JApplicationWeb then?
I just saw there is already a $responseMap array

avatar mbabker
mbabker - comment - 7 Sep 2016

That works too. I didn't know if it had a hard reference to the redirect code or if it was "good enough" for general use off the top of my head.

avatar piotr-cz
piotr-cz - comment - 8 Sep 2016

I'd love to split whole phrases like HTTP/1.1 300 Multiple Choices in JApplicationWeb::$responseMap into protocol version, code and text just like in Symfony\Component\HttpFoundation\Response or Slim\Http\Response, make property public static and refactor JApplicationWeb::redirect method accordingly.

As ATM it's private, are there any reasons to not to do so?

Moreover what's the workflow?
Start with Joomla Framework Application AbstratWebApplication
then JApplicationWeb
and then adjust JDocumentError::render method?

avatar yild
yild - comment - 8 Sep 2016

btw @piotr-cz if you search whole code for HTTP/1.1 you will find more files in which they can be found than I posted earlier but I don't know if there is need for them to be translatable (even to plain ASCII form).

avatar brianteeman brianteeman - change - 8 Sep 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 9 Sep 2016
Category Language & Strings
avatar brianteeman brianteeman - change - 9 Oct 2016
Status New Confirmed
avatar mbabker
mbabker - comment - 27 Apr 2017

With e4d0451 the status header only includes the Exception message if error reporting is at maximum.

avatar mbabker mbabker - change - 27 Apr 2017
The description was changed
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-04-27 01:44:08
Closed_By mbabker
avatar mbabker mbabker - close - 27 Apr 2017

Add a Comment

Login with GitHub to post a comment