silverstripe/sapphire — pull request #863 by tractorcow (2012-10-11 01:02:43+00:00)
Title: BUG: Fixed use of DI in the Security controller

The security controller currently creates a nested Page_Controller instance, and populates it with a dummy Page object.

The issue is that by using "new Page_Controller" this process subverts dependency injection, and means that any Page_Controller with registered dependencies will not be properly initialised.

This fix replaces the object creation lines with Page_Controller::create() as per the convention.

I should probably have applied the same to the "new Page()" items, but I'm unsure whether or not it would be correct for DataObjects to have their own dependencies, so I opted for the simplest fix.