Skip to content
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

Slack Module error: array_merge(): Argument #2 is not an array at /Modules/Slack/Providers/SlackServiceProvider.php:221 #444

Closed
ePascalC opened this issue Jan 21, 2020 · 1 comment

Comments

@ePascalC
Copy link

ePascalC commented Jan 21, 2020

I received the following error in the slack module:
[2020-01-21 21:56:21] production.ERROR: array_merge(): Argument #2 is not an array {"exception":"[object] (ErrorException(code: 0): array_merge(): Argument #2 is not an array at /home/user/public_html/example.com/Modules/Slack/Providers/SlackServiceProvider.php:221)
[stacktrace]
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_merge(): ...', '/home/wpeurope/...', 221, Array)
#1 /home/wpeurope/public_html/support.wp-europe.org/Modules/Slack/Providers/SlackServiceProvider.php(221): array_merge(Array, NULL)

I fixed it now by adding a check on 'empty' (so also NULL) and that seems to work for me, but maybe a deeper analysis will be needed

   \Eventy::addAction('slack.post', function($conversation, $pretext, $fields = [], $color = '') {
       if (empty($fields))
            $fields = [];
            
        // Detect channel by mailbox.
        $channel = '';
        $mailbox_id = $conversation->mailbox_id;
@freescout-helpdesk
Copy link
Contributor

Fixed in Slack Module v1.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants