Skip to content

Fix fatal error issue in in_array function #445

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

itsmekopila
Copy link

Fix: #429

A fatal error occurred in the in_array function when the site options auto_update_plugins and auto_update_themes were set to string values. I fixed this by adding a condition to check if they are not arrays.

@itsmekopila itsmekopila requested a review from a team as a code owner March 18, 2025 08:41
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@mrsdizzie mrsdizzie added the bug label Mar 19, 2025
@mrsdizzie mrsdizzie added this to the 2.1.24 milestone Mar 19, 2025
@swissspidy
Copy link
Member

Would you be up for adding a test for this as well?

Please also update the branch by merging the latest changes from the main branch

@swissspidy
Copy link
Member

Hmm now there are some changes from main in this diff 🤔 I was thinking more of a simple git merge main or git rebase main. But anyhow, some tests would be good. Let us know if you need help with that.

@swissspidy
Copy link
Member

@itsmekopila friendly ping 👋 would you be able to address the diff issues and add some tests?

@itsmekopila
Copy link
Author

@itsmekopila friendly ping 👋 would you be able to address the diff issues and add some tests?

I'm setting up WP-CLI tests locally to run tests and will fix diff issues.

@itsmekopila
Copy link
Author

itsmekopila commented Apr 1, 2025

Hi @swissspidy,

Could you please guide me on how to set up the database and connect it properly to run Behat? I followed the WP CLI tests guide but ran into some issues. It seems like I wasn't able to connect the database correctly. When I run the composer run prepare-tests command, I get the error shown in the attached file. Also, when I run composer run behat, it just gets stuck and doesn’t load anything. I try with database type splite also.

Could you please guide me through the setup and testing process from the start?

Thanks in advance!

image
image
image

@swissspidy
Copy link
Member

Since you're using MariaDB, I'd suggest running composer update again.

We just merged some MariaDB-related improvements on Friday to make running tests more robust. Then composer run prepare-tests should work better.

Using SQLite is a nice workaround though, then you don't need to run prepare-tests. But strange that it fails for you 🤔

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

Successfully merging this pull request may close these issues.

get_site_option returns empty string causing exception in Plugin_Command.php
3 participants