dss-web / gravityforms-uploads-azure

Add support for offloading Gravity Forms Uploads to the Microsoft Azure cloud.
MIT License
0 stars 0 forks source link

PHP Fatal error #3

Closed gkarmas closed 2 years ago

gkarmas commented 2 years ago

Hello,

First of all THANKS a ton for this plugin! Only GF to Azure connector that exists!

I can't seem to make it run. As soon as I activate the plugin, constantly getting this error:

2021/12/28 21:42:17 [error] 10582#0: *12598892 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Dekode\GravityForms\Azure\Controller::__construct() must be of the type array, bool given, called in /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-addon.php on line 109 and defined in /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-controller.php:37
Stack trace:
#0 /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-addon.php(109): Dekode\GravityForms\Azure\Controller->__construct()
#1 /var/www/vhosts/site.com/httpdocs/wp-includes/class-wp-hook.php(303): Dekode\GravityForms\Azure\AddOn->init()
#2 /var/www/vhosts/site.com/httpdocs/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
#3 /var/www/vhosts/site.com/httpdocs/wp-includes/plugin.php(470): WP_Hook->do_action()
#4 /var/www/vhosts/site.com/httpdocs/wp-settings.php(578): do" while reading response header from upstream, client: 172.70.90.102, server: site.com, request: "GET /wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s&swcfpc=1 HTTP/1.1", upstream: "fastcgi://unix:/var/www/vhosts/system/site.com/php-fpm.sock:", host: "site.com", referrer: "https://site.com/wp-admin/plugins.php"
2021/12/28 21:42:19 [error] 10582#0: *12598888 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Dekode\GravityForms\Azure\Controller::__construct() must be of the type array, bool given, called in /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-addon.php on line 109 and defined in /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-controller.php:37
Stack trace:
#0 /var/www/vhosts/site.com/httpdocs/wp-content/plugins/gravityforms-uploads-azure-main/includes/class-addon.php(109): Dekode\GravityForms\Azure\Controller->__construct()
#1 /var/www/vhosts/site.com/httpdocs/wp-includes/class-wp-hook.php(303): Dekode\GravityForms\Azure\AddOn->init()
#2 /var/www/vhosts/site.com/httpdocs/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
#3 /var/www/vhosts/site.com/httpdocs/wp-includes/plugin.php(470): WP_Hook->do_action()
#4 /var/www/vhosts/site.com/httpdocs/wp-settings.php(578): do" while reading response header from upstream, client: 172.70.90.86, server: site.com, request: "GET /wp-admin/plugins.php HTTP/1.1", upstream: "fastcgi://unix:/var/www/vhosts/system/site.com/php-fpm.sock:", host: "site.com", referrer: "https://site.com/wp-admin/admin.php?page=gf_addons"

Also, a little side note, the node refuses to install the packages with npm:

PS C:\Users\George.DESKTOP\WebstormProjects\gfazure> npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: undefined,
npm WARN EBADENGINE   required: { node: '16', npm: '7', yarn: 'Please use npm' },
npm WARN EBADENGINE   current: { node: 'v16.13.0', npm: '8.1.4' }
npm WARN EBADENGINE }

> postinstall
> mkdir ./azurite

The syntax of the command is incorrect.
npm ERR! code 1
npm ERR! path C:\Users\George.DESKTOP\WebstormProjects\gfazure
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c mkdir ./azurite

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\George.DESKTOP-E0LPO2P\AppData\Local\npm-cache\_logs\2021-12-29T02_20_08_414Z-debug.log

PS C:\Users\George.DESKTOP-E0LPO2P\WebstormProjects\gfazure> npm run azure
npm ERR! Missing script: "azure"

Best, George.

Clorith commented 2 years ago

Thank you for the report @gkarmas, this has been remedied with the upcoming version 1.0.1, and was caused by a default value when no relevant settings existed when this plugin was enabled.