New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6.0 saving addon settings is broken #1507

Closed
rrelmy opened this Issue Jul 19, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@rrelmy

rrelmy commented Jul 19, 2017

[2017-07-19 15:14:58] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function input() on null in C:\projects\subpixel\statamic\core\Http\Controllers\AddonsController.php:174

The AddonsController got its own __constructor but does not call its parents constructor, therefor the $this->request is not initialized

Workaround

Replace the current constructor with this

    public function __construct(Request $request, AddonRepository $addonRepo)
    {
        parent::__construct($request);

        $this->addonRepo = $addonRepo;
    }

and add use Illuminate\Http\Request; to the imports

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jul 19, 2017

Or just parent::__construct(request()); for the moment, and then don't worry about adding arguments or imports.

@rrelmy

This comment has been minimized.

rrelmy commented Jul 19, 2017

@jasonvarga it is not the only controller with this pattern, maybe you need to fix the others too

Of course that is a easier workaround

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jul 19, 2017

Which others?

@rrelmy

This comment has been minimized.

rrelmy commented Jul 19, 2017

Only FieldtypesController but it has no usage of $this->request in it

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jul 19, 2017

Cool then we're good. Will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment