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

FIXED: Warning: in_array() expects parameter 2 to be array, boolean given in .../plugins/wordpress-seo/admin/class-yoast-plugin-conflict.php on line 269 #14379

Open
4 of 9 tasks
fnorte opened this issue Feb 14, 2020 · 1 comment
Labels
severity: trivial Yoast: Management Issues about options and management of the plugin

Comments

@fnorte
Copy link

fnorte commented Feb 14, 2020

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

In my development enviroment in a multisite installation, one of the sites report this warning:
Warning: in_array() expects parameter 2 to be array, boolean given in (...)/plugins/wordpress-seo/admin/class-yoast-plugin-conflict.php on line 269

Following the code I realized that the object in line #74, is retrive a boll(false) instead an array , necessary in the line that occured the Warning :
$this->all_active_plugins = get_option( 'active_plugins' );

the unknow reason, that I need personally investigate is why this wordpress base function "get_option", that supposed to list the active plugins is empty.

Please describe what you expected to happen and why.

Since the possibility of this false response in that funcion, for safety I decided to change the bollean false response to put this type inside an array to avoid this warning, when this object is used in a necessary array type variable, change this line to this:
$this->all_active_plugins = (array) get_option( 'active_plugins', array() );

How can we reproduce this behavior?

  1. I don't know yeat, because I need to understand why the active plugins list is returned false

Technical info

  • If relevant, which editor is affected (or editors):
  • Classic Editor
  • Gutenberg
  • Classic Editor plugin
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other

Used versions

  • WordPress version: 5.3.2 (pt_br)
  • Yoast SEO version: 13.0
  • Gutenberg plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
  • Tested with theme: Sparkling (child modificaation) by Colorlib.com
@Djennez
Copy link
Member

Djennez commented Feb 18, 2020

Hi @fnorte and thanks for the report. You're right, we should check for an array here. I'll mark this as a valid bug report, though not one with high priority.

@dariaknl dariaknl added the Yoast: Management Issues about options and management of the plugin label Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: trivial Yoast: Management Issues about options and management of the plugin
Projects
None yet
Development

No branches or pull requests

3 participants