Fixed Account::preDispatchController() updates breaks /account URL for XF2.2.x

Xon

Well-known member
Licensed customer
Affected version
2.2.19P2
The rollup update includes this snippet;

PHP:
	protected function preDispatchController($action, ParameterBag $params)
	{
		$this->response()->header('Cache-Control', 'no-store');

		$this->assertRegistrationRequired();
}

Except $this->response() doesn't exist, and will throw this error;
Code:
Error: Call to undefined method XF\Pub\Controller\Account::response() in src/XF/Pub/Controller/Account.php at line 16
XF\Pub\Controller\Account->preDispatchController() in src/XF/Pub/Controller/AbstractController.php at line 34
XF\Pub\Controller\AbstractController->preDispatchType() in src/XF/Mvc/Controller.php at line 126
XF\Mvc\Controller->preDispatch() in src/XF/Pub/Controller/Account.php at line 26
XF\Pub\Controller\Account->preDispatch() in src/XF/Mvc/Dispatcher.php at line 351
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2523
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20

The XF2.3 version is;
PHP:
	protected function preDispatchController($action, ParameterBag $params)
	{
		$this->assertRegistrationRequired();

		$this->app()->response()->header('Cache-Control', 'no-store');
	}
 
Last edited:
Thanks for heads up. The download has been patched to fix this rather than doing a full release.

If you're affected, a manual upload of the src/XF/Pub/Controller/Account.php and src/addons/XF/hashes.json files from a freshly downloaded package should do the trick.
 
Thanks for heads up. The download has been patched to fix this rather than doing a full release.

If you're affected, a manual upload of the src/XF/Pub/Controller/Account.php and src/addons/XF/hashes.json files from a freshly downloaded package should do the trick.
Thanks for this, saved my bacon this morning/woke me up!
 
Back
Top Bottom