jsmrtn / craftagram

Grab Instagram content through the Instagram Basic Display API
Other
14 stars 8 forks source link

Return value must be of type mixed, none returned #61

Closed thomas-soemoen closed 1 year ago

thomas-soemoen commented 1 year ago

Hei there.

When I did a fresh install in Craft 4 on php 8.1.12 I got the following error when I tried to view the settings:

/admin/settings/plugins/craftagram

scaramangagency\craftagram\Craftagram::getSettingsResponse(): Return value must be of type mixed, none returned

in line 151

    public function getSettingsResponse(): mixed {
        Craft::$app->controller->redirect(UrlHelper::cpUrl('craftagram/settings'));
    }

The site is on Craft 4.3.6.1, php 8.1.12 and the plugin is 2.0.1.

tomkiss commented 1 year ago

Also seeing this error on PHP 8.1, latest versions of Craft and Plugin, unable to install.

tomkiss commented 1 year ago

OK, I discovered by uninstalling and reinstalling via the CP that there is a URL issue.

It looks like the two CP links to settings, linked in the logo icon here:

Screenshot 2023-02-03 at 10 31 34

And "settings" text here:

Screenshot 2023-02-03 at 10 31 21

...both link to the wrong place.

The both link to: /admin/settings/plugins/craftagram.

If you install via command line, you only ever see links to this broken URL.

Whereas, if you install via CP, after installation you are automatically taken to /admin/craftagram/settings/1?site, which appears to work OK.

Hope this is helpful!

jsmrtn commented 1 year ago

Fixed in 2.0.2