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

make sure $settings is an array #3342

Merged
merged 2 commits into from Oct 4, 2018

Conversation

Projects
None yet
2 participants
@bragle
Copy link
Contributor

commented Oct 3, 2018

No description provided.

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

Have you run into a case where it isn’t an array?

@bragle

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2018

Yeah, sorry for the lack of a description. It might be a bit difficult to replicate, but if it affects me, it also might affect other people. I've updated craft 2.6 to 3 with the Analytics (dukt) plugin, and I get this error when I load the dashboard: array_merge(): Argument #2 is not an array. I dumped the variable and from what i understand, Analytics is trying to pass (string) "null" as the settings value. There are multiple ways of fixing this, but i believe checking if $settings is an array is the best solution because it would prevent anyone from running into this issue again. Alternatively, checking if settings is "null" or fixing the plugin itself would work, but if there are any other cases like this, they too will get this error.

@brandonkelly brandonkelly merged commit 4e12e49 into craftcms:develop Oct 4, 2018

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

Makes sense, thanks!

brandonkelly added a commit that referenced this pull request Oct 4, 2018

@bragle bragle deleted the bragle:patch-1 branch Oct 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.