Skip to content

Import get_flag_value() from WP_CLI\Utils before using. #1271

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 1 commit into
base: trunk
Choose a base branch
from

Conversation

barryhughes
Copy link
Member

As identified in the linked issue, we are attempting to use a namespaced function without importing or fully qualifying it, leading to a fatal error when attempting to create an action via WP CLI.

Closes #1270.


Steps to replicate

  • Using the current stable release (3.9.2), try running wp action-scheduler create test now and you will experience a fatal error.
  • Switch to this branch and repeat the test. The action should successfully be created.

Changelog

Fixed fatal error occuring when creating an action via WP CLI.

@barryhughes
Copy link
Member Author

✍🏼 Probably worth noting, I don't see the same problem in any of the related classes: we either import the function, or fully qualify it. That said, I do see a warning when using wp action-scheduler action get <id> which I'll create a separate PR for.

@barryhughes
Copy link
Member Author

Unit tests are failing in many cases, but it seems to be because of this part of the setup process:

curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip

woocommerce/phpunit seems to have gone away, or perhaps permissions have changed?

@barryhughes barryhughes requested review from a team and albarin and removed request for a team June 3, 2025 13:13
Copy link
Contributor

@albarin albarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Confirmed the fatal error is no longer happening after this fix.

@barryhughes
Copy link
Member Author

✍🏼 Just a note that I lack the powers to merge this change (though perhaps we want to wait on #1273 being addressed so we can verify this doesn't break anything, which of course is totally fine).

@barryhughes barryhughes force-pushed the fix/ACTSCH-68/action-create-command branch from c27c91d to faf3065 Compare June 18, 2025 20:27
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

Successfully merging this pull request may close these issues.

Using the CLI command wp action-scheduler action create command experiences a critical error
2 participants