buddypress / wp-cli-buddypress

WP-CLI Community Package of BuddyPress commands
GNU General Public License v3.0
47 stars 19 forks source link

Scaffold command not found #87

Closed imath closed 3 years ago

imath commented 3 years ago

Hi @renatonascalves could you have a look to this https://buddypress.org/support/topic/buddypress-7-2-0/#post-317390 ?

Thanks 😊

contemplate commented 3 years ago

It's happening on at least two different client sites on different servers. Both use the Kleo theme.
We started seeing it on Feb. 16th.

renatonascalves commented 3 years ago

Interesting! Will be taking a look as soon as possible.

VivekShingala commented 3 years ago

Hi @renatonascalves / @imath

I am also facing this issue on one of the sites. The error message logs a daily basis at a fixed time (3 AM UTC in my case). Could you please suggest if that is the part of any scheduler which runs daily?

[01-Mar-2021 03:01:38 UTC] PHP Fatal error:  Class 'Scaffold_Command' not found in /wp-content/plugins/buddypress/cli/src/scaffold.php on line 19
[01-Mar-2021 03:01:42 UTC] PHP Fatal error:  Class 'Scaffold_Command' not found in /wp-content/plugins/buddypress/cli/src/scaffold.php on line 19
renatonascalves commented 3 years ago

The BP CLI doesn't add any scheduler. It is likely another scheduler trying to run and catching this error.

VivekShingala commented 3 years ago

Hi @renatonascalves

How do we fix class not found error for Scaffold_Command? Did you resolve that already?

renatonascalves commented 3 years ago

It is on my to do list! :)

contemplate commented 3 years ago

Curious @renatonascalves would this error at all mess up permalinks in Wordpress? One of the sites started having periodic permalink errors causing 404s around the same time we upgraded to the latest Buddypress. However other sites ( that also have this error ) are not having this issue.

VivekShingala commented 3 years ago

Curious @renatonascalves would this error at all mess up permalinks in Wordpress? One of the sites started having periodic permalink errors causing 404s around the same time we upgraded to the latest Buddypress. However other sites ( that also have this error ) are not having this issue.

Yes, we are also facing the same issue related to permalink errors which leads to 404 pages.

renatonascalves commented 3 years ago

^ This is a fix for this issue!

There are scenarios that I didn't anticipate where the Scaffold package is not installed. Since we rely on a class from it for our custom scaffold command, you guys are getting that error when it is not available.

Based on the feedback gathered so far, it appears that when any command is being run, one gets the Class Scaffold_Command not found in. And that's consistent in my view since those files are only loaded in the WP CLI context.

bsoryn commented 3 years ago

Hello gent's,

What is the fix in this case? Below is my log if it helps in any way:

[22-Mar-2021 06:31:36 UTC] PHP Fatal error: Uncaught Error: Class 'Scaffold_Command' not found in /wp-content/plugins/buddypress/cli/src/scaffold.php:19 Stack trace:

0 /wp-content/plugins/buddypress/cli/wp-cli-bp.php(38): require_once()

1 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(254): BuddyPress->Buddypress\CLI{closure}()

2 /wp-content/plugins/buddypress/cli/wp-cli-bp.php(165): WP_CLI::add_hook('before_wp_load', Object(Closure))

3 /wp-content/plugins/buddypress/class-buddypress.php(522): require('/home/efkhnlmy/...')

4 /wp-content/plugins/buddypress/class-buddypress.php(125): BuddyPress->includes()

5 /wp-content/plugins/buddypress/bp-loader.php(46): BuddyPress::instance()

6 /wp-content/plugins/buddypress/bp-loader.php(90): buddypress()

7 /wp-content/plugins/buddypress/cli/src/scaffold.php on line 19

[22-Mar-2021 06:31:38 UTC] PHP Fatal error: Uncaught Error: Class 'Scaffold_Command' not found in /wp-content/plugins/buddypress/cli/src/scaffold.php:19 Stack trace:

0 /wp-content/plugins/buddypress/cli/wp-cli-bp.php(38): require_once()

1 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(254): BuddyPress->Buddypress\CLI{closure}()

2 /wp-content/plugins/buddypress/cli/wp-cli-bp.php(165): WP_CLI::add_hook('before_wp_load', Object(Closure))

3 /plugins/buddypress/class-buddypress.php(522): require('/home/efkhnlmy/...')

4 /wp-content/plugins/buddypress/class-buddypress.php(125): BuddyPress->includes()

5 /wp-content/plugins/buddypress/bp-loader.php(46): BuddyPress::instance()

6 /wp-content/plugins/buddypress/bp-loader.php(90): buddypress()

7 /wp-content/plugins/buddypress/cli/src/scaffold.php on line 19

renatonascalves commented 3 years ago

Right now, wait for the patch to be bundled with the next version of BuddyPress or install it directly (if you like to live dangeously): https://github.com/buddypress/wp-cli-buddypress#installing

saintclaire commented 3 years ago

When will it be available (the patch to be bundled with the next version of BuddyPress) @renatonascalves Please?

renatonascalves commented 3 years ago

Based on the schedule: https://bpdevel.wordpress.com/2021/04/05/bp-dev-chat-summary-march-31-2021/

imath commented 3 years ago

@renatonascalves could you update the BuddyPress Gruntfile.js to use the 2.0.1 tag from now on both trunk and 7.0 branch? I believe we should make this fix available earlier than in 8.0.0, eg: in our next minor release https://buddypress.trac.wordpress.org/milestone/7.3.0

Thanks in advance 😍