?
avatar anibalsanchez
anibalsanchez
2 May 2017

Steps to reproduce the issue

Extensions running on FOF2 call JApplicationWeb->redirect to generate a 303 redirect AND define a Status 201. For example, saving an item.

In the past, Joomla generated a http 303 to the url and exited.

Now, J3.7 is calling the redirect AND generating the rest of headers, cancelling the 303 redirection that originated the call.

Expected result

Successfull redirection

Actual result

Blank page. No redirection. In the browser, headers show the Location where the browser must go and a non-300 Status header.

System information (as much as possible)

Joomla 3.7

Additional comments

The redirection call must use the same API to generate the headers AND replace any previously defined Status. A fix is coming.

JApplicationWeb, line 567

			// All other cases use the more efficient HTTP header for redirection.
			$this->setHeader('Status', $this->responseMap[$status], true);
			$this->setHeader('Location', $url, true);
avatar anibalsanchez anibalsanchez - open - 2 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 May 2017
avatar anibalsanchez
anibalsanchez - comment - 2 May 2017

Hi @franz-wohlkoenig , no, I've just tested the PR. #15730 is unrelated with this issue.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15737.

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 May 2017
Category com_redirect
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 May 2017
Status New Discussion
avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

PR here #15738

avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

@franz-wohlkoenig bit slow today? hahahahah close please.

avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2017
Closed_Date 2017-05-02 15:10:19 2017-05-02 15:10:20
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 2 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-02 15:10:19
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 2 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 May 2017

closed as having PR #15738.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15737.

avatar nayemmajhar
nayemmajhar - comment - 3 May 2017

There is a another fix without depending on core for FOF2 support. I have a view called item. For fix, I create a contoller name item.php and rewrite FOF2 redirect method

class MycomponentControllerItem extends FOFController
{

	public function redirect()
	{
		if ($this->redirect)
		{
			$app = JFactory::getApplication();
			$app->enqueueMessage($this->message, $this->messageType);
			$app->setHeader('Status', 'HTTP/1.1 303 See other', true);
			$app->setHeader('Location', $this->redirect, true);
			$app->redirect($this->redirect);
			return true;
		}
		return false;
	}

}
avatar anibalsanchez
anibalsanchez - comment - 3 May 2017

Hi @nayemmajhar ,

Only the status must be corrected, because it was previously defined as 201. I've also added the Status update in my extension controllers for J 3.7.0.

Regards,

Add a Comment

Login with GitHub to post a comment