Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
413 stars 56 forks source link

Command not found: acorn #150

Closed RobDobsonNC closed 1 year ago

RobDobsonNC commented 1 year ago

Hello - I'm using Sage, have installed Acorn and am running

acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider"

within the theme folder.

I get command not found 'acorn' (or command not found, wp, which I just assume is because I'm on a Mac).

I'm new to all this, or rather old, but getting back into a new way of working using Sage. Can you possibly help?

davideprevosto commented 1 year ago

You should use

wp acorn etc... assuming wp cli is running on your Mac.

RobDobsonNC commented 1 year ago

Thank you David, much appreciated. Now however, I get the following two errors:

Deprecated: Creation of dynamic property WP_CLI\Dispatcher\Subcommand::$longdesc is deprecated in phar:///usr/local/Cellar/wp-cli/2.7.1/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php on line 38

and

Error: Error establishing a database connection.

Any ideas? Thank you

davideprevosto commented 1 year ago

About the deprecation notice, please double check the PHP version you're using.

For the second error you need to check your local connection to the MySQL service for example. Or double check the database credentials.

RobDobsonNC commented 1 year ago

Thanks David. PHP is the latest version, 8.2.2. I'm not sure why it's not connecting to the DB, everything seems to be running ok otherwise.

Log1x commented 1 year ago

You'll need to use PHP 8.0 as WP-CLI hardly has 8.1 support let alone 8.2.

As far as database goes, are you using Local by Flywheel? I hear a lot of people having this issue using Local - but I'm not 100% sure how to fix it outside of making sure you're running these commands inside of Local (this issue affects WP-CLI usage in general and is not related to ACF Composer).

davideprevosto commented 1 year ago

You should avoid using PHP 8.2.2 with WordPress. Stay safe with PHP 8.0.x or at least PHP 8.1.x

RobDobsonNC commented 1 year ago

@Log1x Yes, Local by Flywheel. If I run the same query:

wp acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider"

Within Local I get:

INFO No publishable resources for tag [].

But no other errors. Thanks for the PHP advice @davideprevosto

Log1x commented 1 year ago

There might be something going on with it stripping slashes.

Try just doing wp acorn vendor:publish and selecting ACF Composer.

If ACF Composer doesn't show up, run wp acorn package:discover and then trying publishing again.

RobDobsonNC commented 1 year ago

Thank you (I think) that worked, and I have Example.php now in app/Fields, though I can't see it within ACF.

Log1x commented 1 year ago

You won't see it in ACF, but it should be showing up when editing a post.

I think ACF Extended can show fields registered with PHP but you wouldn't be able to modify the field group or anything.

RobDobsonNC commented 1 year ago

Sorry, I'm being dumb. Where should I be looking?

I added a block, which has worked wonderfully easy, thank you.

RobDobsonNC commented 1 year ago

Did a fresh re-install, everything works as expected. Thanks!